public final class XpathUtil extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<AbstractNode> |
createChildren(AbstractNode root,
AbstractNode parent,
DetailAST firstChild)
Iterates siblings of the given node and creates new Xpath-nodes.
|
static java.lang.String |
getTextAttributeValue(DetailAST ast)
Returns content of the text attribute of the ast element.
|
static java.lang.String |
printXpathBranch(java.lang.String xpath,
java.io.File file)
Returns xpath query results on file as string.
|
static boolean |
supportsTextAttribute(DetailAST ast)
Checks, if specified node can have
@text attribute. |
public static java.util.List<AbstractNode> createChildren(AbstractNode root, AbstractNode parent, DetailAST firstChild)
root - the root nodeparent - the parent nodefirstChild - the first DetailASTpublic static boolean supportsTextAttribute(DetailAST ast)
@text attribute.ast - DetailAst element@text attribute, false otherwisepublic static java.lang.String getTextAttributeValue(DetailAST ast)
ast - DetailAst elementpublic static java.lang.String printXpathBranch(java.lang.String xpath, java.io.File file) throws CheckstyleException, java.io.IOException
xpath - query to evaluatefile - file to run onCheckstyleException - if some parsing error happensjava.io.IOException - if an error occursCopyright © 2001-2020. All Rights Reserved.