|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.qedeq.kernel.xml.tracker.SimpleXPath
public class SimpleXPath
Simple XPath like description of a location in an XML file.
Constructor Summary | |
---|---|
SimpleXPath()
Empty constructor. |
|
SimpleXPath(SimpleXPath original)
Copy constructor. |
|
SimpleXPath(java.lang.String xpath)
Constructor with simple XPath string as parameter. |
Method Summary | |
---|---|
void |
addElement(java.lang.String elementName)
Add new element to end of XPath. |
void |
addElement(java.lang.String elementName,
int occurrence)
Add new element to end of XPath. |
void |
deleteLastElement()
Delete last XPath element if any. |
boolean |
equals(java.lang.Object obj)
|
boolean |
equalsElements(SimpleXPath other)
Are the elements and occurrences of this and another element equal? No special treatment of "*" elements. |
java.lang.String |
getAttribute()
Get attribute. |
java.lang.String |
getBeforeLastElement()
Get XPath element name before last. |
java.lang.String |
getElementName(int i)
Get i -th Element name. |
int |
getElementOccurrence(int i)
Get i -th occurrence number. |
java.lang.String |
getLastElement()
Get last XPath element name. |
int |
hashCode()
|
boolean |
matchesElements(SimpleXPath current,
SimpleXPath currentSummary)
Match the elements and occurrences of this finder object and current elements? This object may contain "*" elements. |
boolean |
matchesElementsBegining(SimpleXPath current,
SimpleXPath currentSummary)
Match the elements and occurrences of this finder object and current elements? This object may contain "*" elements. |
void |
setAttribute(java.lang.String attribute)
Set attribute. |
int |
size()
Get number of collected exceptions. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleXPath(java.lang.String xpath)
/element1/element2[3]@attribute
is an example for such
a notation. This selects from the first occurrence of element1
and from the third occurrence of subnode element2
the attribute
attribute
. The attribute is optional. It is always exactly one node or
the attribute of one node specified.
The general syntax could be described as follows: {"/"element"["index"]"}+ ["@"attribute]
xpath
- String with the syntax as described above. If the syntax is violated
RuntimeExceptions may occur.public SimpleXPath()
public SimpleXPath(SimpleXPath original)
original
- XPath to copy.Method Detail |
---|
public final int size()
public final java.lang.String getElementName(int i)
i
-th Element name.
i
- Starts with 0 and must be smaller than size()
.
public final int getElementOccurrence(int i)
i
-th occurrence number.
i
- Starts with 0 and must be smaller than size()
.
public final void addElement(java.lang.String elementName)
elementName
- element to add.public final void addElement(java.lang.String elementName, int occurrence)
elementName
- element to add.occurrence
- Occurrence number of element. Starts with 1.public final java.lang.String getLastElement()
null
if no elements exist.public final java.lang.String getBeforeLastElement()
null
if no more than one element
exist.public void deleteLastElement()
public final void setAttribute(java.lang.String attribute)
attribute
- Attribute, maybe null
.public final java.lang.String getAttribute()
null
.public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public final boolean equalsElements(SimpleXPath other)
other
- Compare with this object.
public final boolean matchesElements(SimpleXPath current, SimpleXPath currentSummary)
current
- Compare with this current elements. These elements should not
contain "*" elements.currentSummary
- Contains only "*" elements. This parameter must be identify the same
XPath as current
public final boolean matchesElementsBegining(SimpleXPath current, SimpleXPath currentSummary)
current
- Compare with this current elements. These elements should not
contain "*" elements.currentSummary
- Contains only "*" elements. This parameter must be identify the same
XPath as current
public final java.lang.String toString()
toString
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |