Package ro.sync.ecss.extensions.commons
Class XPointerElementLocator
- java.lang.Object
-
- ro.sync.ecss.extensions.api.link.ElementLocator
-
- ro.sync.ecss.extensions.commons.XPointerElementLocator
-
@API(type=INTERNAL, src=PUBLIC) public class XPointerElementLocator extends ElementLocator
Element locator for links that have the one of the following patterns:- element(elementID) - locate the element with the same id
- element(/1/2/5) - A child sequence appearing alone identifies an element by means of stepwise navigation, which is directed by a sequence of integers separated by slashes (/); each integer n locates the nth child element of the previously located element.
- element(elementID/3/4) - A child sequence appearing after an NCName identifies an element by means of stepwise navigation, starting from the element located by the given name.
-
-
Field Summary
-
Fields inherited from class ro.sync.ecss.extensions.api.link.ElementLocator
link
-
-
Constructor Summary
Constructors Constructor Description XPointerElementLocator(IDTypeVerifier idVerifier, java.lang.String link)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
Notification received when the end of an element has been encountered.boolean
startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, Attr[] atts)
Notification received when the beginning of an element has been encountered.
-
-
-
Constructor Detail
-
XPointerElementLocator
public XPointerElementLocator(IDTypeVerifier idVerifier, java.lang.String link) throws ElementLocatorException
Constructor.- Parameters:
idVerifier
- Verifies if an given attribute has the type ID.link
- The link that gives the element position.- Throws:
ElementLocatorException
- When the link format is not supported.
-
-
Method Detail
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
Description copied from class:ElementLocator
Notification received when the end of an element has been encountered. This method is invoked at the end of every element in the XML document; an event will be fired for everyendElement
(even when the element is empty).- Specified by:
endElement
in classElementLocator
- Parameters:
uri
- the namespace URI, or the empty string if the element has no namespace URI or if namespace processing is not being performedlocalName
- the local name of the elementname
- the qualified XML name of the element- See Also:
ElementLocator.endElement(java.lang.String, java.lang.String, java.lang.String)
-
startElement
public boolean startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, Attr[] atts)
Description copied from class:ElementLocator
Notification received when the beginning of an element has been encountered. This method is invoked at the beginning of every element in the XML document; an event will be fired for everystartElement
(even when the element is empty).- Specified by:
startElement
in classElementLocator
- Parameters:
uri
- the namespace URI, or the empty string if the element has no namespace URI or if namespace processing is not being performedlocalName
- the local name of the elementname
- the qualified name of the elementatts
- an array with the attributes attached to the element. If there are no attributes, it shall be empty. The attributes are represented asAttr
objects.- Returns:
true
if the current element is indicated by the link.- See Also:
ElementLocator.startElement(java.lang.String, java.lang.String, java.lang.String, ro.sync.ecss.extensions.api.link.Attr[])
-
-