Class OrphanXmlElement

java.lang.Object
com.android.manifmerger.XmlNode
com.android.manifmerger.OrphanXmlElement
Direct Known Subclasses:
XmlElement

public class OrphanXmlElement extends XmlNode
An xml element that does not belong to a XmlDocument
  • Constructor Details

    • OrphanXmlElement

      public OrphanXmlElement(@NonNull Element xml, @NonNull com.android.manifmerger.DocumentModel<com.android.manifmerger.ManifestModel.NodeTypes> model)
  • Method Details

    • isA

      public boolean isA(com.android.manifmerger.ManifestModel.NodeTypes type)
      Returns true if this xml element's ManifestModel.NodeTypes is the passed one.
    • getXml

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

      @NonNull public String getNamespaceURI()
    • getTagName

      @NonNull public String getTagName()
    • getAttributeValue

      @Nullable public String getAttributeValue(String namespaceUri, String localName)
    • getAttributeInfo

      @Nullable public String getAttributeInfo(String namespaceUri, String attributeName)
    • lookupNamespacePrefix

      @NonNull public String lookupNamespacePrefix(@NonNull String nsUri, boolean create)
    • lookupNamespacePrefix

      @NonNull public String lookupNamespacePrefix(@NonNull String nsUri, @NonNull String defaultPrefix, boolean create)
    • getAttributeNode

      @NonNull public Attr getAttributeNode(String name)
    • getAttributeNodeNS

      @Nullable public Attr getAttributeNodeNS(String namespaceURI, String localName)
    • getId

      @NonNull public XmlNode.NodeKey getId()
      Description copied from class: XmlNode
      Returns an unique id within the manifest file for the element.
      Specified by:
      getId in class XmlNode
    • getName

      @NonNull public XmlNode.NodeName getName()
      Description copied from class: XmlNode
      Returns the name of this xml element or attribute.
      Specified by:
      getName in class XmlNode
    • getType

      @NonNull public com.android.manifmerger.ManifestModel.NodeTypes getType()
      Returns this xml element ManifestModel.NodeTypes
    • getKey

      @Nullable public String getKey()
      Returns the unique key for this xml element within the xml file or null if there can be only one element of this type.
    • 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
    • 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