public class XPathUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_ATTRIBUTE |
static int |
TYPE_TAG |
static int |
TYPE_TAG_WITH_ATTRIBUTE |
Constructor and Description |
---|
XPathUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getElementName(String xPath)
Return element name without any selector.
|
static String |
getElementNameWithSelector(String xPath) |
static int |
getElementPosition(String xPath)
Return element position if it exist.
|
static String |
getElementPrefix(String xPath)
Retrieve the element prefix
|
static Map<String,String> |
getElementSelectorAttributes(String xPath)
Returns the selector attributes of this XPath
|
static int |
getElementType(String xPath)
Returns the type of the element described by this xPath query.
|
static String |
getElementXPath(String fieldXPath)
Retrieve the xpath element from the specified xpath.
|
static boolean |
isAttributeXPath(String fieldXPath)
Retrieve the xpath element from the specified xpath.
|
public static final int TYPE_ATTRIBUTE
public static final int TYPE_TAG
public static final int TYPE_TAG_WITH_ATTRIBUTE
public static String getElementName(String xPath)
Attribute names are returned with a starting '@'
xPath
- the XPath querypublic static int getElementPosition(String xPath)
xPath
- the XPath querypublic static String getElementPrefix(String xPath)
xPath
- the XPath querypublic static Map<String,String> getElementSelectorAttributes(String xPath)
xPath
- XPathpublic static int getElementType(String xPath)
xPath
- the XPath queryXMLFieldUtils#getElementSelectorAttributes(String)
,
getElementName
,
getElementNameWithSelector(String)
public static String getElementXPath(String fieldXPath)
fieldXPath
- xpath mapped to a fieldpublic static boolean isAttributeXPath(String fieldXPath)
fieldXPath
- xpath mapped to a fieldCopyright © 2011–2014. All rights reserved.