org.jopendocument.util
Class SimpleXMLPath<T>

java.lang.Object
  extended by org.jopendocument.util.SimpleXMLPath<T>
Type Parameters:
T - type of result.

public final class SimpleXMLPath<T>
extends Object

Like an XPath with less features but a greater speed. Thread-safe if its steps are.

Author:
Sylvain CUAZ

Method Summary
static SimpleXMLPath<org.jdom.Attribute> allAttributes(String name, String ns)
          Create a path searching for all descendant attributes with the passed name and namespace.
static SimpleXMLPath<org.jdom.Element> allElements(String name, String ns)
          Create a path searching for all descendant elements with the passed name and namespace.
static
<T> SimpleXMLPath<T>
create(List<Step<?>> steps, Step<T> lastStep)
           
static
<T> SimpleXMLPath<T>
create(Step<?> first, Step<?> second, Step<T> lastStep)
           
static
<T> SimpleXMLPath<T>
create(Step<?> first, Step<T> lastStep)
           
static
<T> SimpleXMLPath<T>
create(Step<T> lastStep)
           
 List<T> selectNodes(List<?> nodes)
           
 List<T> selectNodes(Object n)
           
 T selectSingleNode(Object n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static <T> SimpleXMLPath<T> create(List<Step<?>> steps,
                                          Step<T> lastStep)

create

public static <T> SimpleXMLPath<T> create(Step<T> lastStep)

create

public static <T> SimpleXMLPath<T> create(Step<?> first,
                                          Step<T> lastStep)

create

public static <T> SimpleXMLPath<T> create(Step<?> first,
                                          Step<?> second,
                                          Step<T> lastStep)

allAttributes

public static SimpleXMLPath<org.jdom.Attribute> allAttributes(String name,
                                                              String ns)
Create a path searching for all descendant attributes with the passed name and namespace. I.e. in XPath this would be ".//@ns:name".

Parameters:
name - the name of attributes.
ns - the namespace of attributes.
Returns:
a path searching attributes in all Step.Axis.descendantOrSelf elements.

allElements

public static SimpleXMLPath<org.jdom.Element> allElements(String name,
                                                          String ns)
Create a path searching for all descendant elements with the passed name and namespace. I.e. in XPath this would be ".//ns:name".

Parameters:
name - the name of elements.
ns - the namespace of elements.
Returns:
a path searching all Step.Axis.descendantOrSelf elements.

selectSingleNode

public final T selectSingleNode(Object n)

selectNodes

public final List<T> selectNodes(Object n)

selectNodes

public final List<T> selectNodes(List<?> nodes)


Copyright © 2010 jOpenDocument All Rights Reserved.