|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.sdo.helper.XPathEngine
public class XPathEngine
Purpose: Perform operations based on SDO XPath against DataObjects.
Field Summary | |
---|---|
protected static XPathEngine |
defaultXPathEngine |
private static int |
ISSET |
private static int |
SET |
private static int |
UNSET |
Constructor Summary | |
---|---|
private |
XPathEngine() |
Method Summary | |
---|---|
private int |
acquireNumberAtDot(java.lang.String frag, int dotIndex) Extract the position (index) from a dot fragment of path |
private int |
acquireNumberInBrackets(java.lang.String frag, int openBracketIndex, int closeBracketIndex) Extract position (index) from a bracket fragment of path |
java.lang.Object |
convertObjectToValueByPath(java.lang.String path, java.lang.Class cls, DataObject caller) access the wanted values through path and convert it into required java class. |
java.lang.Object |
get(java.lang.String path, DataObject caller) When accessing values corresponding to properties of DataObject by path base accessors, the accessed getters will pass informations to this method to process information and acquire wanted values. |
private DataObject |
getDataObjectFromQuery(java.lang.String frag, int openBracketIndex, int closeBracketIndex, int equalsignIndex, DataObject caller, java.lang.String callerProperty) Access the DataObject value by using the fragment containing query informations. |
static XPathEngine |
getInstance() |
private java.lang.String |
getLocalName(java.lang.String qualifiedName) |
private int |
getNumberInFrag(java.lang.String frag, int indexOfDot, int indexOfOpenBracket, int indexOfCloseBracket) Judge if positional path belongs to bracket case or dot case, then perform different actions. |
private java.lang.Object |
getObjectByFragment(java.lang.String propertyName, int position, DataObject caller) Check if position exists, then either acquire value through position or directly. |
private java.lang.String |
getPropertyNameInFrag(java.lang.String frag, int position, int indexOfDot, int indexOfOpenBracket) Extract the property name hidden in a fragment of path |
private java.lang.Object |
getValueForFragment(java.lang.String frag, DataObject caller) Process the passed in fragment, extract the position information if available, acquire the property name hidden in this fragment and check if this fragment is actually query base. |
private int |
isQueryPath(java.lang.String frag, int openBracketIndex, int closeBracketIndex) check if information in brackets is qury or not. |
private boolean |
isSet(Property lastProperty, DataObject lastDataObject) Method that returns whether a property is set. |
boolean |
isSet(java.lang.String path, DataObject caller) Handle queries about setting status of a property through path base access. |
private boolean |
processPath(java.lang.String path, java.lang.Object value, DataObject caller, boolean convertValue, int _case) extract wanted fragment from the string representation of path and pass processed result to method setIsSetUnSet for further operation. |
private void |
set(Property lastProperty, DataObject lastDataObject, int numInLastProperty, java.lang.Object value, boolean convertValue) Set a property's value. |
void |
set(java.lang.String path, java.lang.Object value, DataObject caller, boolean convertValue) Set a property's value through the path base access. |
private boolean |
setIsSetUnSet(java.lang.String frag, java.lang.String path, DataObject caller, java.lang.Object value, int lastSlashIndex, boolean convertValue, int _case) According to the requirement, correspondingly perform isset, unset or set function. |
private void |
unSet(Property lastProperty, DataObject lastDataObject, int numInLastProperty) Method that unset a certain property's value. |
void |
unset(java.lang.String path, DataObject caller) Unset the value of a property through the path base access. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int SET
private static final int ISSET
private static final int UNSET
protected static XPathEngine defaultXPathEngine
Constructor Detail |
---|
private XPathEngine()
Method Detail |
---|
public static XPathEngine getInstance()
public boolean isSet(java.lang.String path, DataObject caller)
path
- the String representation of path based accesscaller
- the DataObject that pass path information inpublic void unset(java.lang.String path, DataObject caller)
path
- the String representation of path based accesscaller
- the DataObject that pass path information inpublic void set(java.lang.String path, java.lang.Object value, DataObject caller, boolean convertValue)
path
- the String representation of path based accessvalue
- the value to be set as the target property's valuecaller
- the DataObject that pass path information inconvertValue
- boolean used for set if we should convert the valuepublic java.lang.Object get(java.lang.String path, DataObject caller)
path
- the String representation of path based accesscaller
- the DataObject that pass path information inprivate boolean processPath(java.lang.String path, java.lang.Object value, DataObject caller, boolean convertValue, int _case)
path
- the String representation of path based accessvalue
- the value to be set as the target property's valuecaller
- the DataObject that pass path information inconvertValue
- boolean used for set if we should convert the value_case
- an int value indicating what kind of operation to use: set, isset or unset.private boolean setIsSetUnSet(java.lang.String frag, java.lang.String path, DataObject caller, java.lang.Object value, int lastSlashIndex, boolean convertValue, int _case)
frag
- one string fragment in the pathpath
- the String representation of path based accesscaller
- the DataObject that pass path information invalue
- the value to be set as the target property's valuelastSlashIndex
- the last index of '/' in the path stringconvertValue
- boolean used for set if we should convert the value_case
- an int value indicating what kind of operation to use: set, isset or unset.private boolean isSet(Property lastProperty, DataObject lastDataObject)
lastProperty
- the property to queries.lastDataObject
- the DataObject, owner of the queried propertyprivate void unSet(Property lastProperty, DataObject lastDataObject, int numInLastProperty)
lastProperty
- the property to queries.lastDataObject
- the DataObject, owner of the queried propertyprivate void set(Property lastProperty, DataObject lastDataObject, int numInLastProperty, java.lang.Object value, boolean convertValue)
lastProperty
- the property to queries.lastDataObject
- the DataObject, owner of the queried propertynumInLastProperty
- the index number in the value list of the above propertyvalue
- the value to be set as the target property's valueconvertValue
- boolean used for set if we should convert the valueprivate java.lang.String getLocalName(java.lang.String qualifiedName)
private java.lang.Object getValueForFragment(java.lang.String frag, DataObject caller)
frag
- one string fragment in the pathcaller
- a DataObject that originally took the path informationprivate java.lang.String getPropertyNameInFrag(java.lang.String frag, int position, int indexOfDot, int indexOfOpenBracket)
frag
- one string fragment in the pathposition
- the index of values to be accessedindexOfDot
- the index of . in the fragmentindexOfOpenBracket
- the indexof [ in the fragmentprivate int getNumberInFrag(java.lang.String frag, int indexOfDot, int indexOfOpenBracket, int indexOfCloseBracket)
frag
- one string fragment in the pathindexOfDot
- the index of . in the fragmentindexOfOpenBracket
- the index of [ in the fragmentindexOfCloseBracket
- the index of ] in the fragmentprivate int isQueryPath(java.lang.String frag, int openBracketIndex, int closeBracketIndex)
frag
- a fragment in pathopenBracketIndex
- index of open bracket in fragmentcloseBracketIndex
- index of close bracket in fragmentprivate DataObject getDataObjectFromQuery(java.lang.String frag, int openBracketIndex, int closeBracketIndex, int equalsignIndex, DataObject caller, java.lang.String callerProperty)
frag
- one string fragment in the pathopenBracketIndex
- the index of open bracket in a fragmentcloseBracketIndex
- the index of close bracket in a fragmentequalsignIndex
- the index of equalsign in string fragment quoted by bracketscaller
- the DataObject that passes the path information incallerProperty
- the name of the propertyprivate java.lang.Object getObjectByFragment(java.lang.String propertyName, int position, DataObject caller)
propertyName
- the name of property of the callerposition
- the index of values to be accessedcaller
- the DataObject containing property with the passed in property nameprivate int acquireNumberInBrackets(java.lang.String frag, int openBracketIndex, int closeBracketIndex)
frag
- a fragment of pathopenBracketIndex
- the index of [ in pathcloseBracketIndex
- the index of ] in pathprivate int acquireNumberAtDot(java.lang.String frag, int dotIndex)
frag
- a fragment of pathdotIndex
- the index of . in pathpublic java.lang.Object convertObjectToValueByPath(java.lang.String path, java.lang.Class cls, DataObject caller) throws java.lang.ClassCastException
path
- string representation of accessing pathcls
- the java class that accessed value is to be converted tocaller
- the DataObject that pass the path injava.lang.ClassCastException
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |