com.jaxfront.core.type
Class TypePathExecuter

java.lang.Object
  extended by com.jaxfront.core.type.TypePathExecuter

public class TypePathExecuter
extends java.lang.Object

This class perform a type path and gives as result a list of types. Fallowing type path could be performed: /po/comment -> absolut addressing /po/item[2] -> the second child in a list /po/item[list] -> the list type ../comment -> go back to parent and then from there ./item/address/name -> reltive addressing from a type /po/* -> all direct children of po

Version:
1.60

Field Summary
static java.lang.String PREDICATE_LIST
           
 
Constructor Summary
TypePathExecuter()
           
 
Method Summary
 java.util.List getAllIDs(Document dom, java.lang.String idName, boolean onlySerializable)
           
static ListType getIndexedComponentListType(Type rootType, java.lang.String xpath)
          Returns the JAXFront ListType based on a indexed xpath. e.q.
static TypePathExecuter getInstance()
          Returns the sinle instance of TypePathExecuter.
static java.lang.String getRelativeXPathLocation(java.lang.String xpath)
           
 Type getTypeForXPath(Type rootType, java.lang.String xpath)
          Processes an xpath expression on the given type and returns the first found type.
 Type getTypeForXPath(Type rootType, java.lang.String xpath, boolean isEditingTypeIncluded)
          Processes an xpath expression on the given type and returns the first found type.
 Type getTypeForXPath(Type rootType, java.lang.String xpath, boolean isEditingTypeIncluded, boolean isListTypeIncluded)
          Processes an xpath expression on the given type and returns the first found type.
 Type getTypeForXPath(Type rootType, java.lang.String xpath, boolean isEditingTypeIncluded, boolean isListTypeIncluded, boolean edTypeTraversal, boolean serializableOnly, boolean buildLazyChoices)
          Processes an xpath expression on the given type and returns the first found type.
static boolean isAddressingIndexedComponent(java.lang.String xpath)
          Returns true if the passed xpath is addressing an indexed type. e.q.
static boolean isLastAddressingIndexedComponent(java.lang.String xpath)
          Returns true if the passed xpath is addressing an indexed type. e.q.
 java.util.List processXPath(Type rootType, java.lang.String path)
          Evaluates an xpath statement and returns the list of addressed types.
 java.util.List processXPath(Type rootType, java.lang.String path, boolean isEditingTypeIncluded)
          Evaluates an xpath statement and returns the list of addressed types.
 java.util.List processXPath(Type rootType, java.lang.String path, boolean isEditingTypeIncluded, boolean isListTypeIncluded)
          Evaluates an xpath statement and returns the list of addressed types.
 java.util.List processXPath(Type rootType, java.lang.String path, boolean isEditingTypeIncluded, boolean isListTypeIncluded, boolean edTypeTraversal)
           
 java.util.List processXPath(Type rootType, java.lang.String path, boolean isEditingTypeIncluded, boolean isListTypeIncluded, boolean edTypeTraversal, boolean serializableOnly)
           
 java.util.List processXPath(Type rootType, java.lang.String path, boolean isEditingTypeIncluded, boolean isListTypeIncluded, boolean edTypeTraversal, boolean serializableOnly, boolean buildLazyChoices)
           
 java.util.List processXPath(Type rootType, java.lang.String path, boolean isEditingTypeIncluded, boolean isListTypeIncluded, boolean edTypeTraversal, boolean serializableOnly, boolean buildLazyChoices, boolean cachedMode)
           
 java.util.List processXPath(Type rootType, java.lang.String path, boolean isEditingTypeIncluded, boolean isListTypeIncluded, boolean edTypeTraversal, boolean serializableOnly, boolean buildLazyChoices, boolean cachedMode, boolean choosenOnly)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREDICATE_LIST

public static final java.lang.String PREDICATE_LIST
See Also:
Constant Field Values
Constructor Detail

TypePathExecuter

public TypePathExecuter()
Method Detail

getIndexedComponentListType

public static ListType getIndexedComponentListType(Type rootType,
                                                   java.lang.String xpath)
Returns the JAXFront ListType based on a indexed xpath. e.q. /po/items[1] will return the 'items' ListType.

Parameters:
rootType - start point to evaluate xpath
xpath - indexed xpath

getInstance

public static TypePathExecuter getInstance()
Returns the sinle instance of TypePathExecuter.


getRelativeXPathLocation

public static java.lang.String getRelativeXPathLocation(java.lang.String xpath)

isAddressingIndexedComponent

public static boolean isAddressingIndexedComponent(java.lang.String xpath)
Returns true if the passed xpath is addressing an indexed type. e.q. /po/items[1]

Parameters:
xpath - potential indexed xpath
Returns:

isLastAddressingIndexedComponent

public static boolean isLastAddressingIndexedComponent(java.lang.String xpath)
Returns true if the passed xpath is addressing an indexed type. e.q. /po/items[1]

Parameters:
xpath - potential indexed xpath
Returns:

getTypeForXPath

public Type getTypeForXPath(Type rootType,
                            java.lang.String xpath)
Processes an xpath expression on the given type and returns the first found type.

Parameters:
rootType - a type on which the xpath should be applied on
xpath - an xpath expression
Returns:
Type the first found type

getTypeForXPath

public Type getTypeForXPath(Type rootType,
                            java.lang.String xpath,
                            boolean isEditingTypeIncluded)
Processes an xpath expression on the given type and returns the first found type.

Parameters:
rootType - a type on which the xpath should be applied on
xpath - an xpath expression
isEditingTypeIncluded - indicates if the editing type of ListTypes should be returned too
Returns:
Type the first found type

getTypeForXPath

public Type getTypeForXPath(Type rootType,
                            java.lang.String xpath,
                            boolean isEditingTypeIncluded,
                            boolean isListTypeIncluded)
Processes an xpath expression on the given type and returns the first found type.

Parameters:
rootType - a type on which the xpath should be applied on
xpath - an xpath expression
isEditingTypeIncluded - indicates if the editing type of ListTypes should be returned too
isListTypeIncluded - indicates if a ListType should be returned or its content
Returns:
Type the first found type

getTypeForXPath

public Type getTypeForXPath(Type rootType,
                            java.lang.String xpath,
                            boolean isEditingTypeIncluded,
                            boolean isListTypeIncluded,
                            boolean edTypeTraversal,
                            boolean serializableOnly,
                            boolean buildLazyChoices)
Processes an xpath expression on the given type and returns the first found type.

Parameters:
rootType - a type on which the xpath should be applied on
xpath - an xpath expression
isEditingTypeIncluded - indicates if the editing type of ListTypes should be returned too
isListTypeIncluded - indicates if a ListType should be returned or its content
Returns:
Type the first found type

processXPath

public java.util.List processXPath(Type rootType,
                                   java.lang.String path)
Evaluates an xpath statement and returns the list of addressed types.

Parameters:
rootType - start point to evaluate xpath
path - xpath to evaluate

getAllIDs

public java.util.List getAllIDs(Document dom,
                                java.lang.String idName,
                                boolean onlySerializable)

processXPath

public java.util.List processXPath(Type rootType,
                                   java.lang.String path,
                                   boolean isEditingTypeIncluded)
Evaluates an xpath statement and returns the list of addressed types.

Parameters:
rootType - start point to evaluate xpath
path - xpath to evaluate
isEditingTypeIncluded - indicates if the editing type of ListTypes should be returned too

processXPath

public java.util.List processXPath(Type rootType,
                                   java.lang.String path,
                                   boolean isEditingTypeIncluded,
                                   boolean isListTypeIncluded)
Evaluates an xpath statement and returns the list of addressed types.

Parameters:
rootType - start point to evaluate xpath
path - xpath to evaluate
isEditingTypeIncluded - indicates if the editing type of ListTypes should be returned too
isListTypeIncluded - indicates if a list type is in the target list

processXPath

public java.util.List processXPath(Type rootType,
                                   java.lang.String path,
                                   boolean isEditingTypeIncluded,
                                   boolean isListTypeIncluded,
                                   boolean edTypeTraversal)

processXPath

public java.util.List processXPath(Type rootType,
                                   java.lang.String path,
                                   boolean isEditingTypeIncluded,
                                   boolean isListTypeIncluded,
                                   boolean edTypeTraversal,
                                   boolean serializableOnly)

processXPath

public java.util.List processXPath(Type rootType,
                                   java.lang.String path,
                                   boolean isEditingTypeIncluded,
                                   boolean isListTypeIncluded,
                                   boolean edTypeTraversal,
                                   boolean serializableOnly,
                                   boolean buildLazyChoices)
Parameters:
rootType -
path -
isEditingTypeIncluded -
isListTypeIncluded -
edTypeTraversal -
serializableOnly -
buildLazyChoices -
Returns:

processXPath

public java.util.List processXPath(Type rootType,
                                   java.lang.String path,
                                   boolean isEditingTypeIncluded,
                                   boolean isListTypeIncluded,
                                   boolean edTypeTraversal,
                                   boolean serializableOnly,
                                   boolean buildLazyChoices,
                                   boolean cachedMode)
Parameters:
rootType -
path -
isEditingTypeIncluded -
isListTypeIncluded -
edTypeTraversal -
serializableOnly -
buildLazyChoices -
Returns:

processXPath

public java.util.List processXPath(Type rootType,
                                   java.lang.String path,
                                   boolean isEditingTypeIncluded,
                                   boolean isListTypeIncluded,
                                   boolean edTypeTraversal,
                                   boolean serializableOnly,
                                   boolean buildLazyChoices,
                                   boolean cachedMode,
                                   boolean choosenOnly)