com.android.manifmerger
Class XmlAttribute

java.lang.Object
  extended by com.android.manifmerger.XmlNode
      extended by com.android.manifmerger.XmlAttribute

public class XmlAttribute
extends XmlNode

Defines an XML attribute inside a XmlElement. Basically a facade object on Attr objects with some added features like automatic namespace handling, manifest merger friendly identifiers and smart replacement of shortened full qualified class names using manifest node's package setting from the the owning Android's document.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.android.manifmerger.XmlNode
XmlNode.NodeKey, XmlNode.NodeName
 
Field Summary
 
Fields inherited from class com.android.manifmerger.XmlNode
NODE_TO_NAME
 
Constructor Summary
XmlAttribute(XmlElement ownerElement, org.w3c.dom.Attr xml, com.android.manifmerger.AttributeModel attributeModel)
          Creates a new facade object to a Attr xml attribute in a XmlElement.
 
Method Summary
 XmlNode.NodeKey getId()
          Returns a display friendly identification string that can be used in machine and user readable messages.
 com.android.manifmerger.AttributeModel getModel()
           
 XmlNode.NodeName getName()
          Returns the attribute's name, providing isolation from details like namespaces handling.
 com.android.utils.PositionXmlParser.Position getPosition()
          Returns the element's position
 XmlLoader.SourceLocation getSourceLocation()
          Returns the element's document xml source file location.
 java.lang.String getValue()
          Returns the attribute's value
 org.w3c.dom.Attr getXml()
          Returns the element's xml
 
Methods inherited from class com.android.manifmerger.XmlNode
fromNSName, fromXmlName, getColumn, getLine, printPosition, printPosition, unwrapName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlAttribute

public XmlAttribute(@NonNull
                    XmlElement ownerElement,
                    @NonNull
                    org.w3c.dom.Attr xml,
                    @Nullable
                    com.android.manifmerger.AttributeModel attributeModel)
Creates a new facade object to a Attr xml attribute in a XmlElement.

Parameters:
ownerElement - the xml node object owning this attribute.
xml - the xml definition of the attribute.
Method Detail

getName

public XmlNode.NodeName getName()
Returns the attribute's name, providing isolation from details like namespaces handling.

Specified by:
getName in class XmlNode

getValue

public java.lang.String getValue()
Returns the attribute's value


getId

public XmlNode.NodeKey getId()
Returns a display friendly identification string that can be used in machine and user readable messages.

Specified by:
getId in class XmlNode

getPosition

public com.android.utils.PositionXmlParser.Position getPosition()
Description copied from class: XmlNode
Returns the element's position

Specified by:
getPosition in class XmlNode

getXml

@NonNull
public org.w3c.dom.Attr getXml()
Description copied from class: XmlNode
Returns the element's xml

Specified by:
getXml in class XmlNode

getModel

@Nullable
public com.android.manifmerger.AttributeModel getModel()

getSourceLocation

@NonNull
public XmlLoader.SourceLocation getSourceLocation()
Description copied from class: XmlNode
Returns the element's document xml source file location.

Specified by:
getSourceLocation in class XmlNode