|
Hilbert II - Version 0.03.01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qedeq.kernel.xml.tracker.SimpleXPath
Simple XPath like description of a location in an XML file.
Constructor Summary | |
SimpleXPath()
|
|
SimpleXPath(String xpath)
Constructor with simple XPath string as parameter. |
Method Summary | |
void |
addElement(String elementName)
Add new element to end of XPath. |
void |
addElement(String elementName,
int occurrence)
Add new element to end of XPath. |
void |
deleteLastElement()
Delete last XPath element if any. |
boolean |
equals(Object obj)
|
boolean |
equalsElements(SimpleXPath other)
Are the elements and occurrences of this and another element equal? |
String |
getAttribute()
Get attribute. |
String |
getBeforeLastElement()
Get XPath element name before last. |
String |
getElementName(int i)
Get i -th Element name. |
int |
getElementOccurrence(int i)
Get i -th occurrence number. |
SourcePosition |
getEndLocation()
Get end location. |
String |
getLastElement()
Get last XPath element name. |
SourcePosition |
getStartLocation()
Get start location. |
int |
hashCode()
|
boolean |
matchesElements(SimpleXPath current,
SimpleXPath currentSummary)
Match the elements and occurrences of this finder object and current elements? |
boolean |
matchesElementsBegining(SimpleXPath current,
SimpleXPath currentSummary)
Match the elements and occurrences of this finder object and current elements? |
void |
setAttribute(String attribute)
Set attribute. |
void |
setEndLocation(SourcePosition position)
Set ending location of XPath. |
void |
setStartLocation(SourcePosition position)
Set starting location of XPath. |
int |
size()
Get number of collected exceptions. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SimpleXPath(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()
Method Detail |
public final int size()
public final 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(String elementName)
elementName
- element to add.public final void addElement(String elementName, int occurrence)
elementName
- element to add.occurrence
- Occurrence number of element. Starts with 1.public final String getLastElement()
null
if no elements exist.public final String getBeforeLastElement()
null
if no more than one element
exist.public void deleteLastElement()
public final void setAttribute(String attribute)
attribute
- Attribute, maybe null
.public final String getAttribute()
null
.public final void setStartLocation(SourcePosition position)
position
- Starting point of this XPath.public final SourcePosition getStartLocation()
public final void setEndLocation(SourcePosition position)
position
- Ending point of this XPath.public final SourcePosition getEndLocation()
public final boolean equals(Object obj)
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 String toString()
public final int hashCode()
|
Hilbert II - Version 0.03.01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
©left GNU General Public Licence All Rights Reserved. |