Class XPathQueryBuilder
java.lang.Object
eu.europa.esig.dss.xml.common.xpath.XPathQueryBuilder
Helper class for building an XPath expression query
eu.europa.esig.dss.xml.common.xpath.XPathQuery-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty constructor instantiating object with empty configuration -
Method Summary
Modifier and TypeMethodDescriptionstatic XPathQueryBuilderall()Instantiates an XPath to search all element occurrencesall(boolean all) Defines if to search all element occurrencesstatic XPathQueryBuilderInstantiates an XPath to search all element occurrences from the current positionattribute(DSSAttribute attribute) Defines the attribute to search.attribute(DSSAttribute attribute, String attributeValue) Defines the attribute with the value to search.build()Builds the XPath expression queryelement(DSSElement element) Defines the element to searchelements(DSSElement... elements) Defines the element path to searchstatic XPathQueryBuilderInstantiates an XPath from the current positionfromCurrentPosition(boolean fromCurrentPosition) Defines if to start XPath from the current positionstatic XPathQueryBuilderfromXPathQuery(XPathQuery xPathQuery) InstantiatesXPathQueryBuilderfrom the existingxPathQuery.Defines the id attribute value to searchnotChildOf(DSSElement notChildOf) Defines that the looking element shall not be a parent ofnotParentOfelement
-
Constructor Details
-
XPathQueryBuilder
protected XPathQueryBuilder()Empty constructor instantiating object with empty configuration
-
-
Method Details
-
fromCurrentPosition
Instantiates an XPath from the current position- Returns:
XPathQueryBuilder
-
fromCurrentPosition
Defines if to start XPath from the current position- Parameters:
fromCurrentPosition- if to start XPath from the current position- Returns:
- this
XPathQueryBuilder
-
all
Instantiates an XPath to search all element occurrences- Returns:
XPathQueryBuilder
-
all
Defines if to search all element occurrences- Parameters:
all- if to search all element occurrences- Returns:
- this
XPathQueryBuilder
-
allFromCurrentPosition
Instantiates an XPath to search all element occurrences from the current position- Returns:
XPathQueryBuilder
-
fromXPathQuery
InstantiatesXPathQueryBuilderfrom the existingxPathQuery. This method will create a newXPathQuery, and when any setters are used, they will override the existing values.- Parameters:
xPathQuery-XPathQueryto instantiate a builder from- Returns:
XPathQueryBuilder
-
element
Defines the element to search- Parameters:
element-DSSElementto search- Returns:
- this
XPathQueryBuilder
-
elements
Defines the element path to search- Parameters:
elements- aDSSElements chain to search- Returns:
- this
XPathQueryBuilder
-
notChildOf
Defines that the looking element shall not be a parent ofnotParentOfelement- Parameters:
notChildOf-DSSElementparent element that shall not be present- Returns:
- this
XPathQueryBuilder
-
attribute
Defines the attribute to search. When used, the attribute is to searched on the child of the last defined element.- Parameters:
attribute-DSSAttribute- Returns:
- this
XPathQueryBuilder
-
attribute
Defines the attribute with the value to search. When used, the attribute is to searched on the child of the last defined element.- Parameters:
attribute-DSSAttributeattributeValue-String- Returns:
- this
XPathQueryBuilder
-
idValue
Defines the id attribute value to search- Parameters:
idValue-String- Returns:
- this
XPathQueryBuilder
-
build
-