public abstract class XmlNode
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XmlNode.Name
Implementation of
XmlNode.NodeName for an node's declaration not using a namespace. |
static class |
XmlNode.NamespaceAwareName
Implementation of the
XmlNode.NodeName for a namespace aware attribute. |
static class |
XmlNode.NodeKey
A xml element or attribute key.
|
static interface |
XmlNode.NodeName
Abstraction to an xml name to isolate whether the name has a namespace or not.
|
| Modifier and Type | Field and Description |
|---|---|
protected static com.google.common.base.Function<org.w3c.dom.Node,java.lang.String> |
NODE_TO_NAME |
| Constructor and Description |
|---|
XmlNode() |
| Modifier and Type | Method and Description |
|---|---|
static XmlNode.NodeName |
fromNSName(java.lang.String namespaceUri,
java.lang.String prefix,
java.lang.String localName) |
static XmlNode.NodeName |
fromXmlName(java.lang.String name) |
abstract XmlNode.NodeKey |
getId()
Returns an unique id within the manifest file for the element.
|
abstract XmlNode.NodeName |
getName()
Returns the name of this xml element or attribute.
|
XmlNode.NodeKey |
getOriginalId()
Returns a constant Nodekey that can be used throughout the lifecycle of the xml element.
|
abstract com.android.ide.common.blame.SourcePosition |
getPosition()
Returns the element's position
|
abstract com.android.ide.common.blame.SourceFile |
getSourceFile()
Returns the element's document xml source file location.
|
com.android.ide.common.blame.SourceFilePosition |
getSourceFilePosition()
Returns the element's document xml source file location.
|
abstract org.w3c.dom.Node |
getXml()
Returns the element's xml
|
java.lang.String |
printPosition()
Returns the position of this attribute in the original xml file.
|
static XmlNode.NodeName |
unwrapName(org.w3c.dom.Node node)
Factory method to create an instance of
XmlNode.NodeName for an existing xml node. |
protected static final com.google.common.base.Function<org.w3c.dom.Node,java.lang.String> NODE_TO_NAME
@NonNull public XmlNode.NodeKey getOriginalId()
getId() can return different values over time as the key of the element can be
for instance, changed through placeholder replacement.@NonNull public abstract XmlNode.NodeKey getId()
@NonNull public abstract com.android.ide.common.blame.SourcePosition getPosition()
@NonNull public abstract com.android.ide.common.blame.SourceFile getSourceFile()
@NonNull public com.android.ide.common.blame.SourceFilePosition getSourceFilePosition()
@NonNull public abstract org.w3c.dom.Node getXml()
@NonNull public abstract XmlNode.NodeName getName()
@NonNull public static XmlNode.NodeName unwrapName(@NonNull org.w3c.dom.Node node)
XmlNode.NodeName for an existing xml node.node - the xml definition.XmlNode.NodeName providing namespace handling.@NonNull public static XmlNode.NodeName fromXmlName(@NonNull java.lang.String name)
@NonNull public static XmlNode.NodeName fromNSName(@NonNull java.lang.String namespaceUri, @NonNull java.lang.String prefix, @NonNull java.lang.String localName)
@NonNull public java.lang.String printPosition()