|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ricebridge.xmlman.in.TargetPath
Represents an XPath expression parsing plan.
For example, /root/foo is represented as two parts, root followed by foo. When root is matched, descend to foo, which becomes the search part. When foo is matched, the target is hit.
To avoid left-over data values from previous records, on the start of a new element, clear all predicate paths and sub paths, but leave other path values alone as they will hold the most recent values.
| Field Summary | |
int |
iInstanceNum
|
| Constructor Summary | |
TargetPath()
Create an empty TargetPath. |
|
TargetPath(PathSpec pPathSpec)
Create a TargetPath from a PathSpec created by the ExprWalker class. |
|
TargetPath(PathSpec pPathSpec,
boolean pNamespaceAware)
Create a TargetPath from a PathSpec created by the ExprWalker class,
and set the namespace awareness. |
|
| Method Summary | |
void |
activate(int pDepth,
DocContext pDocContext)
Activate this path and its precursors (subpaths are activated on target match). |
boolean |
active(DocContext pDocContext)
Indicate that this path is active for the specified document context. |
void |
addSubPath(TargetPath pTargetPath)
Add a subpath to this path. |
void |
addTrigger(DocContext pDocContext,
Trigger pTrigger)
Add a Trigger to be executed when this path matches. |
void |
clear(DocContext pDocContext)
Clear the data value of this path. |
void |
deactivate(DocContext pDocContext)
Deactivate this path, its subpaths and precursors. |
NameInfo |
getAttrNameInfo()
Get the target attribute name. |
com.ricebridge.xmlman.tp.Context |
getContext(DocContext pDocContext)
Get the current Jaxen Context of this path. |
boolean |
getDefaultActivation()
Get the default activation state of this path. |
String |
getDocContextName()
Get the document context name of the data value that this path targets. |
int |
getInstanceNum()
Get the instance number of this path, for debugging. |
int |
getMatchCount(DocContext pDocContext)
Get the number of times this path has matched. |
String |
getName()
Get the name of this path - normally the XPath expression. |
int |
getNumParts()
Get this number of parts in this path. |
TargetPath |
getParentPath()
Get the parent path of which this path is a subpath. |
PathPart |
getPathPartAt(int pPartIndex)
Get the part at the specified index. |
SubPathManager |
getSubPathManager()
Get the SubPathManager containing the subpaths of this path. |
TextInfo |
getTextInfo()
Get the text target description. |
Object |
getValue(DocContext pDocContext)
Get the current data field value of this path. |
boolean |
handleEndPoint(EndPoint pEndPoint,
DocContext pDocContext)
Handle an EndPoint event. |
List |
handleStartPoint(StartPoint pStartPoint,
DocContext pDocContext)
Handle a StartPoint event. |
boolean |
hasAbsoluteParent()
This is a subpath of an absolute path. |
boolean |
hasAttribute()
The target is an attribute. |
boolean |
hasNamespace()
The target is a namespace. |
boolean |
hasParentPath()
This is a subpath of another path. |
boolean |
hasPathPartAt(int pPartIndex)
Check for a part. |
boolean |
hasTextInfo()
The target is a text node. |
boolean |
isAbsolute()
This is an absolute path. |
boolean |
isMatch(StartPoint pStartPoint,
PathContext pPathContext,
int pDepth)
Check if this path matches the start element tag. |
boolean |
isTopLevel()
This is a top level path, this is, it is a data field path that should be activated when a record is matched. |
static String |
makeDocContextName(String pDocContextPrefix,
String pPathName)
Create document context name from the record path name. |
void |
pushContext(int pDepth,
boolean pReplicate,
DocContext pDocContext)
Push the current path context onto the path context stack. |
void |
removeTrigger(DocContext pDocContext,
Trigger pTrigger)
Remove a match Trigger. |
boolean |
requiresClear(DocContext pDocContext)
Indicate that this path is marked for data field clearing. |
boolean |
requiresDeactivation(DocContext pDocContext)
Indicate that this path is marked for deactivation. |
void |
reset(DocContext pDocContext)
Reset this path for a new document. |
void |
resolveTextInfo()
If the target is not defined, then make the target the element text. |
void |
setDefaultActivation(boolean pDefaultActivation)
Set the default activation state of this path. |
void |
setDocContextPrefix(String pDocContextPrefix)
Set the document context prefix for this path and its subpaths. |
void |
setFullRequiresClear(DocContext pDocContext,
boolean pRequiresClear,
String pReason)
Mark this path for data field clearing, and also its subpaths. |
void |
setIsRecord(boolean pIsRecord)
This will be a record path. |
void |
setRequiresDeactivation(DocContext pDocContext,
boolean pRequiresDeactivation)
Mark this path for deactivation by PointHandler. |
void |
setTextInfo(TextInfo pTextInfo)
Set the text target description. |
List |
splitOnDescend()
Paths with descendant axes must be split at these points so that the preceding part can continue to match subelements. |
String |
toString()
Debugging description. |
String |
toString(boolean pIncludeInstanceNum)
Debugging description, including TargetPath instance number, |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int iInstanceNum
| Constructor Detail |
public TargetPath()
TargetPath.
public TargetPath(PathSpec pPathSpec)
PathSpec created by the ExprWalker class.
public TargetPath(PathSpec pPathSpec,
boolean pNamespaceAware)
PathSpec created by the ExprWalker class,
and set the namespace awareness.
| Method Detail |
public List splitOnDescend()
public void resolveTextInfo()
public void setIsRecord(boolean pIsRecord)
public boolean hasParentPath()
public TargetPath getParentPath()
public boolean hasAttribute()
public NameInfo getAttrNameInfo()
public boolean hasTextInfo()
public void setTextInfo(TextInfo pTextInfo)
public TextInfo getTextInfo()
public boolean hasNamespace()
public boolean isAbsolute()
public boolean hasAbsoluteParent()
public boolean isTopLevel()
public void setDocContextPrefix(String pDocContextPrefix)
public void addTrigger(DocContext pDocContext,
Trigger pTrigger)
Trigger to be executed when this path matches.
public void removeTrigger(DocContext pDocContext,
Trigger pTrigger)
Trigger.
public void addSubPath(TargetPath pTargetPath)
public String getName()
public String getDocContextName()
public boolean active(DocContext pDocContext)
public void activate(int pDepth,
DocContext pDocContext)
public void deactivate(DocContext pDocContext)
public void setRequiresDeactivation(DocContext pDocContext,
boolean pRequiresDeactivation)
PointHandler.
public boolean requiresDeactivation(DocContext pDocContext)
public void setFullRequiresClear(DocContext pDocContext,
boolean pRequiresClear,
String pReason)
public boolean requiresClear(DocContext pDocContext)
public void reset(DocContext pDocContext)
public void clear(DocContext pDocContext)
public void setDefaultActivation(boolean pDefaultActivation)
public boolean getDefaultActivation()
public List handleStartPoint(StartPoint pStartPoint,
DocContext pDocContext)
StartPoint event.
List of TextAppender objects
public boolean handleEndPoint(EndPoint pEndPoint,
DocContext pDocContext)
EndPoint event.
true if target element end tag
public boolean isMatch(StartPoint pStartPoint,
PathContext pPathContext,
int pDepth)
public Object getValue(DocContext pDocContext)
public com.ricebridge.xmlman.tp.Context getContext(DocContext pDocContext)
Context of this path.
public int getNumParts()
public boolean hasPathPartAt(int pPartIndex)
public PathPart getPathPartAt(int pPartIndex)
public int getMatchCount(DocContext pDocContext)
public int getInstanceNum()
public SubPathManager getSubPathManager()
SubPathManager containing the subpaths of this path.
public String toString()
public String toString(boolean pIncludeInstanceNum)
TargetPath instance number,
public void pushContext(int pDepth,
boolean pReplicate,
DocContext pDocContext)
Used to manage descendant axes.
public static String makeDocContextName(String pDocContextPrefix,
String pPathName)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||