org.jopendocument.util
Class Step<T>

java.lang.Object
  extended by org.jopendocument.util.Step<T>
Type Parameters:
T - type of items after the step.

public final class Step<T>
extends Object

A step in SimpleXMLPath. There's only 2 types of step, those which go to Element and those which go to Attribute. Thread-safe if its predicate is.

Author:
Sylvain CUAZ

Nested Class Summary
static class Step.Axis
           
 
Method Summary
protected  void add(Object node, List<T> l)
           
static Step<org.jdom.Attribute> createAttributeStep(String name, String ns)
           
static Step<org.jdom.Attribute> createAttributeStep(String name, String ns, IPredicate<org.jdom.Attribute> pred)
           
static Step<org.jdom.Element> createElementStep(Step.Axis axis, String name)
           
static Step<org.jdom.Element> createElementStep(Step.Axis axis, String name, String ns)
           
static Step<org.jdom.Element> createElementStep(Step.Axis axis, String name, String ns, IPredicate<org.jdom.Element> pred)
           
static Step<org.jdom.Element> createElementStep(String name, String ns)
           
static Step<org.jdom.Element> createElementStep(String name, String ns, IPredicate<org.jdom.Element> pred)
           
protected  T evaluate(Object node)
           
static Step<org.jdom.Attribute> getAnyAttributeStep()
          Return a step that match any attribute.
static Step<org.jdom.Element> getAnyChildElementStep()
          Return a step that match any child element.
 Step.Axis getAxis()
           
 String getName()
           
protected  org.jdom.Namespace getNS(org.jdom.Element elem)
           
 IPredicate<T> getPredicate()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAnyAttributeStep

public static Step<org.jdom.Attribute> getAnyAttributeStep()
Return a step that match any attribute.

Returns:
the equivalent of @*.

createAttributeStep

public static Step<org.jdom.Attribute> createAttributeStep(String name,
                                                           String ns)

createAttributeStep

public static Step<org.jdom.Attribute> createAttributeStep(String name,
                                                           String ns,
                                                           IPredicate<org.jdom.Attribute> pred)

getAnyChildElementStep

public static Step<org.jdom.Element> getAnyChildElementStep()
Return a step that match any child element.

Returns:
the equivalent of *.

createElementStep

public static Step<org.jdom.Element> createElementStep(String name,
                                                       String ns)

createElementStep

public static Step<org.jdom.Element> createElementStep(String name,
                                                       String ns,
                                                       IPredicate<org.jdom.Element> pred)

createElementStep

public static Step<org.jdom.Element> createElementStep(Step.Axis axis,
                                                       String name)

createElementStep

public static Step<org.jdom.Element> createElementStep(Step.Axis axis,
                                                       String name,
                                                       String ns)

createElementStep

public static Step<org.jdom.Element> createElementStep(Step.Axis axis,
                                                       String name,
                                                       String ns,
                                                       IPredicate<org.jdom.Element> pred)

getAxis

public final Step.Axis getAxis()

getName

public final String getName()

getPredicate

public final IPredicate<T> getPredicate()

getNS

protected final org.jdom.Namespace getNS(org.jdom.Element elem)

evaluate

protected final T evaluate(Object node)

add

protected final void add(Object node,
                         List<T> l)

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2010 jOpenDocument All Rights Reserved.