Package com.android.manifmerger
Class XmlNode
java.lang.Object
com.android.manifmerger.XmlNode
- Direct Known Subclasses:
OrphanXmlElement,XmlAttribute
Common behavior of any xml declaration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classImplementation ofXmlNode.NodeNamefor an node's declaration not using a namespace.static final classImplementation of theXmlNode.NodeNamefor a namespace aware attribute.static classA xml element or attribute key.static interfaceAbstraction to an xml name to isolate whether the name has a namespace or not. -
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XmlNode.NodeNamefromNSName(String namespaceUri, String prefix, String localName) static XmlNode.NodeNamefromXmlName(String name) abstract XmlNode.NodeKeygetId()Returns an unique id within the manifest file for the element.abstract XmlNode.NodeNamegetName()Returns the name of this xml element or attribute.Returns a constant Nodekey that can be used throughout the lifecycle of the xml element.abstract com.android.ide.common.blame.SourcePositionReturns the element's positionabstract com.android.ide.common.blame.SourceFileReturns the element's document xml source file location.com.android.ide.common.blame.SourceFilePositionReturns the element's document xml source file location.abstract NodegetXml()Returns the element's xmlReturns the position of this attribute in the original xml file.static XmlNode.NodeNameunwrapName(Node node) Factory method to create an instance ofXmlNode.NodeNamefor an existing xml node.
-
Field Details
-
NODE_TO_NAME
-
-
Constructor Details
-
XmlNode
public XmlNode()
-
-
Method Details
-
getOriginalId
Returns a constant Nodekey that can be used throughout the lifecycle of the xml element. ThegetId()can return different values over time as the key of the element can be for instance, changed through placeholder replacement. -
getId
Returns an unique id within the manifest file for the element. -
getPosition
@NonNull public abstract com.android.ide.common.blame.SourcePosition getPosition()Returns the element's position -
getSourceFile
@NonNull public abstract com.android.ide.common.blame.SourceFile getSourceFile()Returns the element's document xml source file location. -
getSourceFilePosition
@NonNull public com.android.ide.common.blame.SourceFilePosition getSourceFilePosition()Returns the element's document xml source file location. -
getXml
Returns the element's xml -
getName
Returns the name of this xml element or attribute. -
unwrapName
Factory method to create an instance ofXmlNode.NodeNamefor an existing xml node.- Parameters:
node- the xml definition.- Returns:
- an instance of
XmlNode.NodeNameproviding namespace handling.
-
fromXmlName
-
fromNSName
@NonNull public static XmlNode.NodeName fromNSName(@NonNull String namespaceUri, @NonNull String prefix, @NonNull String localName) -
printPosition
Returns the position of this attribute in the original xml file. This may return an invalid location as this xml fragment does not exist in any xml file but is the temporary result of the merging process.- Returns:
- a human readable position.
-