public class XmlFile extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XmlFile.Location |
public static XmlFile create(org.sonar.api.batch.fs.InputFile inputFile) throws IOException
IOException@Nullable public org.sonar.api.batch.fs.InputFile getInputFile()
public String getContents()
public Charset getCharset()
public Document getDocument()
public Document getNamespaceAwareDocument()
public Document getNamespaceUnawareDocument()
public Optional<PrologElement> getPrologElement()
public static XmlTextRange startLocation(CDATASection node)
public static XmlTextRange endLocation(CDATASection node)
public static XmlTextRange startLocation(Element node)
public static XmlTextRange endLocation(Element node)
public static XmlTextRange nameLocation(Element node)
public static XmlTextRange attributeNameLocation(Attr node)
public static XmlTextRange attributeValueLocation(Attr node)
public static XmlTextRange nodeLocation(Node node)
public static Optional<XmlTextRange> getRange(Node node, XmlFile.Location location)
public static List<Node> children(Node node)
node - the node to get children frompublic static List<Node> asList(@Nullable NodeList nodeList)
nodeList - the nodeList to be transformed into a List, possibly null@CheckForNull public static Node nodeAttribute(Node node, String attribute)
node - The node to query for an attributeattribute - The name of the attribute to search forCopyright © 2009–2019 SonarSource. All rights reserved.