com.android.ide.common.xml
Class AndroidManifestParser

java.lang.Object
  extended by com.android.ide.common.xml.AndroidManifestParser

public class AndroidManifestParser
extends java.lang.Object


Nested Class Summary
static interface AndroidManifestParser.ManifestErrorHandler
           
 
Constructor Summary
AndroidManifestParser()
           
 
Method Summary
static ManifestData parse(com.android.io.IAbstractFile manifestFile)
          Parses the Android Manifest, and returns an object containing the result of the parsing.
static ManifestData parse(com.android.io.IAbstractFile manifestFile, boolean gatherData, AndroidManifestParser.ManifestErrorHandler errorHandler)
          Parses the Android Manifest, and returns a ManifestData object containing the result of the parsing.
static ManifestData parse(com.android.io.IAbstractFolder projectFolder)
           
static ManifestData parse(java.io.InputStream manifestFileStream)
          Parses the Android Manifest from an InputStream, and returns a ManifestData object containing the result of the parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndroidManifestParser

public AndroidManifestParser()
Method Detail

parse

public static ManifestData parse(com.android.io.IAbstractFile manifestFile,
                                 boolean gatherData,
                                 AndroidManifestParser.ManifestErrorHandler errorHandler)
                          throws org.xml.sax.SAXException,
                                 java.io.IOException,
                                 com.android.io.StreamException,
                                 javax.xml.parsers.ParserConfigurationException
Parses the Android Manifest, and returns a ManifestData object containing the result of the parsing.

Parameters:
manifestFile - the IAbstractFile representing the manifest file.
gatherData - indicates whether the parsing will extract data from the manifest. If false the method will always return null.
errorHandler - an optional errorHandler.
Returns:
A class containing the manifest info obtained during the parsing, or null on error.
Throws:
com.android.io.StreamException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

parse

public static ManifestData parse(com.android.io.IAbstractFile manifestFile)
                          throws org.xml.sax.SAXException,
                                 java.io.IOException,
                                 com.android.io.StreamException,
                                 javax.xml.parsers.ParserConfigurationException
Parses the Android Manifest, and returns an object containing the result of the parsing.

This is the equivalent of calling

parse(manifestFile, true, null)

Parameters:
manifestFile - the manifest file to parse.
Throws:
javax.xml.parsers.ParserConfigurationException
com.android.io.StreamException
java.io.IOException
org.xml.sax.SAXException

parse

public static ManifestData parse(com.android.io.IAbstractFolder projectFolder)
                          throws org.xml.sax.SAXException,
                                 java.io.IOException,
                                 com.android.io.StreamException,
                                 javax.xml.parsers.ParserConfigurationException
Throws:
org.xml.sax.SAXException
java.io.IOException
com.android.io.StreamException
javax.xml.parsers.ParserConfigurationException

parse

public static ManifestData parse(java.io.InputStream manifestFileStream)
                          throws org.xml.sax.SAXException,
                                 java.io.IOException,
                                 com.android.io.StreamException,
                                 javax.xml.parsers.ParserConfigurationException
Parses the Android Manifest from an InputStream, and returns a ManifestData object containing the result of the parsing.

Parameters:
manifestFileStream - the InputStream representing the manifest file.
Returns:
A class containing the manifest info obtained during the parsing or null on error.
Throws:
com.android.io.StreamException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException