it.geosolutions.geoserver.rest.encoder.utils
Class ElementUtils

java.lang.Object
  extended by it.geosolutions.geoserver.rest.encoder.utils.ElementUtils

public abstract class ElementUtils
extends Object

Author:
Carlo Cancellieri - carlo.cancellieri@geo-solutions.it

Constructor Summary
ElementUtils()
           
 
Method Summary
static org.jdom.Element contains(org.jdom.Element root, org.jdom.Element el)
           
static org.jdom.Element contains(org.jdom.Element root, org.jdom.filter.Filter filter)
           
static org.jdom.Element contains(org.jdom.Element root, String name)
          return the FIRST element with name equals to the passed key
static org.jdom.Element contains(org.jdom.Element root, String name, int deep)
          return the FIRST element with name equals to the passed key
static org.jdom.Element contains(org.jdom.Element root, String name, String val)
           
static boolean remove(org.jdom.Element root, org.jdom.Element el)
           
static List<org.jdom.Element> search(org.jdom.Element root, org.jdom.filter.Filter filter)
           
static List<org.jdom.Element> search(org.jdom.Element root, org.jdom.filter.Filter filter, int depth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementUtils

public ElementUtils()
Method Detail

remove

public static boolean remove(org.jdom.Element root,
                             org.jdom.Element el)
                      throws IllegalArgumentException
Parameters:
root - the root where to start searching to element to remove
el - the element to remove (will be set to null since this node is unusable after removal)
Returns:
true if the element EQUALS to the 'el' starting from root (including) is found, false if object 'el' is not found
Throws:
IllegalArgumentException

search

public static List<org.jdom.Element> search(org.jdom.Element root,
                                            org.jdom.filter.Filter filter,
                                            int depth)
                                     throws IllegalArgumentException
Parameters:
root -
filter -
depth - the max depth to search. Use contains(final Element root, final Filter filter) for an infinite depth search
Returns:
Throws:
IllegalArgumentException

search

public static List<org.jdom.Element> search(org.jdom.Element root,
                                            org.jdom.filter.Filter filter)

contains

public static org.jdom.Element contains(org.jdom.Element root,
                                        org.jdom.filter.Filter filter)
                                 throws IllegalArgumentException
Parameters:
root -
name -
val -
Returns:
the FIRST element matching the passed filter or null
Throws:
IllegalArgumentException

contains

public static org.jdom.Element contains(org.jdom.Element root,
                                        String name,
                                        String val)
                                 throws IllegalArgumentException
Parameters:
root -
name -
val -
Returns:
the FIRST element EQUALS to a node with name and a text value starting from root or null
Throws:
IllegalArgumentException

contains

public static org.jdom.Element contains(org.jdom.Element root,
                                        String name)
return the FIRST element with name equals to the passed key

Parameters:
root -
name -
Returns:

contains

public static org.jdom.Element contains(org.jdom.Element root,
                                        String name,
                                        int deep)
                                 throws IllegalArgumentException
return the FIRST element with name equals to the passed key

Parameters:
root -
name -
Returns:
Throws:
IllegalArgumentException

contains

public static org.jdom.Element contains(org.jdom.Element root,
                                        org.jdom.Element el)
                                 throws IllegalArgumentException
Parameters:
root -
el -
Returns:
the FIRST element EQUALS to the 'el' starting from root or null This tests for equality of this Content object to the supplied object. Content items are considered equal only if they are referentially equal (i.e. the same object).
Throws:
IllegalArgumentException


Copyright © 2007-2013 GeoSolutions. All Rights Reserved.