Class XmlAttribute

java.lang.Object
com.android.manifmerger.XmlNode
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.
  • Constructor Details

    • XmlAttribute

      public XmlAttribute(@NonNull XmlElement ownerElement, @NonNull 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 Details

    • createXmlAttribute

      public static XmlAttribute createXmlAttribute(XmlElement ownerElement, Attr attribute)
    • getName

      @NonNull public XmlNode.NodeName getName()
      Returns the attribute's name, providing isolation from details like namespaces handling.
      Specified by:
      getName in class XmlNode
    • getValue

      @NonNull public String getValue()
      Returns the attribute's value
    • getId

      @NonNull 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

      @NonNull public com.android.ide.common.blame.SourcePosition getPosition()
      Description copied from class: XmlNode
      Returns the element's position
      Specified by:
      getPosition in class XmlNode
    • getXml

      @NonNull public Attr getXml()
      Description copied from class: XmlNode
      Returns the element's xml
      Specified by:
      getXml in class XmlNode
    • setValue

      public void setValue(String value)
    • getModel

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

      @NonNull public com.android.ide.common.blame.SourceFile getSourceFile()
      Description copied from class: XmlNode
      Returns the element's document xml source file location.
      Specified by:
      getSourceFile in class XmlNode