Class AXmlResourceParser

java.lang.Object
brut.androlib.res.decoder.AXmlResourceParser
All Implemented Interfaces:
XmlResourceParser, AttributeSet, org.xmlpull.v1.XmlPullParser
Direct Known Subclasses:
AndroidManifestResourceParser

public class AXmlResourceParser extends Object implements XmlResourceParser
Binary xml files parser.

Parser has only two states: (1) Operational state, which parser obtains after first successful call to next() and retains until open(), close(), or failed call to next(). (2) Closed state, which parser obtains after open(), close(), or failed call to next(). In this state methods return invalid values or throw exceptions.

  • Constructor Details

    • AXmlResourceParser

      public AXmlResourceParser()
  • Method Details

    • getFirstError

      public AndrolibException getFirstError()
    • getAttrDecoder

      public ResAttrDecoder getAttrDecoder()
    • setAttrDecoder

      public void setAttrDecoder(ResAttrDecoder attrDecoder)
    • open

      public void open(InputStream stream)
    • close

      public void close()
      Description copied from interface: XmlResourceParser
      Close this interface to the resource. Calls on the interface are no longer value after this call.
      Specified by:
      close in interface XmlResourceParser
    • next

      public int next() throws org.xmlpull.v1.XmlPullParserException, IOException
      Specified by:
      next in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException
      IOException
    • nextToken

      public int nextToken() throws org.xmlpull.v1.XmlPullParserException, IOException
      Specified by:
      nextToken in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException
      IOException
    • nextTag

      public int nextTag() throws org.xmlpull.v1.XmlPullParserException, IOException
      Specified by:
      nextTag in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException
      IOException
    • nextText

      public String nextText() throws org.xmlpull.v1.XmlPullParserException, IOException
      Specified by:
      nextText in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException
      IOException
    • require

      public void require(int type, String namespace, String name) throws org.xmlpull.v1.XmlPullParserException
      Specified by:
      require in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException
    • getDepth

      public int getDepth()
      Specified by:
      getDepth in interface org.xmlpull.v1.XmlPullParser
    • getEventType

      public int getEventType()
      Specified by:
      getEventType in interface org.xmlpull.v1.XmlPullParser
    • getLineNumber

      public int getLineNumber()
      Specified by:
      getLineNumber in interface org.xmlpull.v1.XmlPullParser
    • getName

      public String getName()
      Specified by:
      getName in interface org.xmlpull.v1.XmlPullParser
    • getText

      public String getText()
      Specified by:
      getText in interface org.xmlpull.v1.XmlPullParser
    • getTextCharacters

      public char[] getTextCharacters(int[] holderForStartAndLength)
      Specified by:
      getTextCharacters in interface org.xmlpull.v1.XmlPullParser
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface org.xmlpull.v1.XmlPullParser
    • getPrefix

      public String getPrefix()
      Specified by:
      getPrefix in interface org.xmlpull.v1.XmlPullParser
    • getPositionDescription

      public String getPositionDescription()
      Specified by:
      getPositionDescription in interface AttributeSet
      Specified by:
      getPositionDescription in interface org.xmlpull.v1.XmlPullParser
    • getNamespaceCount

      public int getNamespaceCount(int depth)
      Specified by:
      getNamespaceCount in interface org.xmlpull.v1.XmlPullParser
    • getNamespacePrefix

      public String getNamespacePrefix(int pos)
      Specified by:
      getNamespacePrefix in interface org.xmlpull.v1.XmlPullParser
    • getNamespaceUri

      public String getNamespaceUri(int pos)
      Specified by:
      getNamespaceUri in interface org.xmlpull.v1.XmlPullParser
    • getClassAttribute

      public String getClassAttribute()
      Specified by:
      getClassAttribute in interface AttributeSet
    • getIdAttribute

      public String getIdAttribute()
      Specified by:
      getIdAttribute in interface AttributeSet
    • getIdAttributeResourceValue

      public int getIdAttributeResourceValue(int defaultValue)
      Specified by:
      getIdAttributeResourceValue in interface AttributeSet
    • getStyleAttribute

      public int getStyleAttribute()
      Specified by:
      getStyleAttribute in interface AttributeSet
    • getAttributeCount

      public int getAttributeCount()
      Specified by:
      getAttributeCount in interface AttributeSet
      Specified by:
      getAttributeCount in interface org.xmlpull.v1.XmlPullParser
    • getAttributeNamespace

      public String getAttributeNamespace(int index)
      Specified by:
      getAttributeNamespace in interface org.xmlpull.v1.XmlPullParser
    • getAttributePrefix

      public String getAttributePrefix(int index)
      Specified by:
      getAttributePrefix in interface org.xmlpull.v1.XmlPullParser
    • getAttributeName

      public String getAttributeName(int index)
      Specified by:
      getAttributeName in interface AttributeSet
      Specified by:
      getAttributeName in interface org.xmlpull.v1.XmlPullParser
    • getAttributeNameResource

      public int getAttributeNameResource(int index)
      Specified by:
      getAttributeNameResource in interface AttributeSet
    • getAttributeValueType

      public int getAttributeValueType(int index)
      Specified by:
      getAttributeValueType in interface AttributeSet
    • getAttributeValueData

      public int getAttributeValueData(int index)
      Specified by:
      getAttributeValueData in interface AttributeSet
    • getAttributeValue

      public String getAttributeValue(int index)
      Specified by:
      getAttributeValue in interface AttributeSet
      Specified by:
      getAttributeValue in interface org.xmlpull.v1.XmlPullParser
    • getAttributeBooleanValue

      public boolean getAttributeBooleanValue(int index, boolean defaultValue)
      Specified by:
      getAttributeBooleanValue in interface AttributeSet
    • getAttributeFloatValue

      public float getAttributeFloatValue(int index, float defaultValue)
      Specified by:
      getAttributeFloatValue in interface AttributeSet
    • getAttributeIntValue

      public int getAttributeIntValue(int index, int defaultValue)
      Specified by:
      getAttributeIntValue in interface AttributeSet
    • getAttributeUnsignedIntValue

      public int getAttributeUnsignedIntValue(int index, int defaultValue)
      Specified by:
      getAttributeUnsignedIntValue in interface AttributeSet
    • getAttributeResourceValue

      public int getAttributeResourceValue(int index, int defaultValue)
      Specified by:
      getAttributeResourceValue in interface AttributeSet
    • getAttributeValue

      public String getAttributeValue(String namespace, String attribute)
      Specified by:
      getAttributeValue in interface AttributeSet
      Specified by:
      getAttributeValue in interface org.xmlpull.v1.XmlPullParser
    • getAttributeBooleanValue

      public boolean getAttributeBooleanValue(String namespace, String attribute, boolean defaultValue)
      Specified by:
      getAttributeBooleanValue in interface AttributeSet
    • getAttributeFloatValue

      public float getAttributeFloatValue(String namespace, String attribute, float defaultValue)
      Specified by:
      getAttributeFloatValue in interface AttributeSet
    • getAttributeIntValue

      public int getAttributeIntValue(String namespace, String attribute, int defaultValue)
      Specified by:
      getAttributeIntValue in interface AttributeSet
    • getAttributeUnsignedIntValue

      public int getAttributeUnsignedIntValue(String namespace, String attribute, int defaultValue)
      Specified by:
      getAttributeUnsignedIntValue in interface AttributeSet
    • getAttributeResourceValue

      public int getAttributeResourceValue(String namespace, String attribute, int defaultValue)
      Specified by:
      getAttributeResourceValue in interface AttributeSet
    • getAttributeListValue

      public int getAttributeListValue(int index, String[] options, int defaultValue)
      Specified by:
      getAttributeListValue in interface AttributeSet
    • getAttributeListValue

      public int getAttributeListValue(String namespace, String attribute, String[] options, int defaultValue)
      Specified by:
      getAttributeListValue in interface AttributeSet
    • getAttributeType

      public String getAttributeType(int index)
      Specified by:
      getAttributeType in interface org.xmlpull.v1.XmlPullParser
    • isAttributeDefault

      public boolean isAttributeDefault(int index)
      Specified by:
      isAttributeDefault in interface org.xmlpull.v1.XmlPullParser
    • setInput

      public void setInput(InputStream stream, String inputEncoding)
      Specified by:
      setInput in interface org.xmlpull.v1.XmlPullParser
    • setInput

      public void setInput(Reader reader) throws org.xmlpull.v1.XmlPullParserException
      Specified by:
      setInput in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException
    • getInputEncoding

      public String getInputEncoding()
      Specified by:
      getInputEncoding in interface org.xmlpull.v1.XmlPullParser
    • getColumnNumber

      public int getColumnNumber()
      Specified by:
      getColumnNumber in interface org.xmlpull.v1.XmlPullParser
    • isEmptyElementTag

      public boolean isEmptyElementTag()
      Specified by:
      isEmptyElementTag in interface org.xmlpull.v1.XmlPullParser
    • isWhitespace

      public boolean isWhitespace()
      Specified by:
      isWhitespace in interface org.xmlpull.v1.XmlPullParser
    • defineEntityReplacementText

      public void defineEntityReplacementText(String entityName, String replacementText) throws org.xmlpull.v1.XmlPullParserException
      Specified by:
      defineEntityReplacementText in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException
    • getNamespace

      public String getNamespace(String prefix)
      Specified by:
      getNamespace in interface org.xmlpull.v1.XmlPullParser
    • getProperty

      public Object getProperty(String name)
      Specified by:
      getProperty in interface org.xmlpull.v1.XmlPullParser
    • setProperty

      public void setProperty(String name, Object value) throws org.xmlpull.v1.XmlPullParserException
      Specified by:
      setProperty in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException
    • getFeature

      public boolean getFeature(String feature)
      Specified by:
      getFeature in interface org.xmlpull.v1.XmlPullParser
    • setFeature

      public void setFeature(String name, boolean value) throws org.xmlpull.v1.XmlPullParserException
      Specified by:
      setFeature in interface org.xmlpull.v1.XmlPullParser
      Throws:
      org.xmlpull.v1.XmlPullParserException