com.android.ide.common.resources
Class IdResourceParser

java.lang.Object
  extended by com.android.ide.common.resources.IdResourceParser

public class IdResourceParser
extends java.lang.Object

Parser for scanning an id-generating resource file such as a layout or a menu file, which registers any ids it encounters with an ValueResourceParser.IValueResourceRepository, and which registers errors with a ScanningContext.


Constructor Summary
IdResourceParser(ValueResourceParser.IValueResourceRepository repository, ScanningContext context, boolean isFramework)
          Creates a new IdResourceParser
 
Method Summary
 boolean parse(com.android.resources.ResourceType type, java.lang.String path, java.io.InputStream input)
          Parse the given input and register ids with the given ValueResourceParser.IValueResourceRepository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdResourceParser

public IdResourceParser(@NonNull
                        ValueResourceParser.IValueResourceRepository repository,
                        @NonNull
                        ScanningContext context,
                        boolean isFramework)
Creates a new IdResourceParser

Parameters:
repository - value repository for registering resource declaration
context - a context object with state for the current update, such as a place to stash errors encountered
isFramework - true if scanning a framework resource
Method Detail

parse

public boolean parse(com.android.resources.ResourceType type,
                     java.lang.String path,
                     java.io.InputStream input)
              throws java.io.IOException
Parse the given input and register ids with the given ValueResourceParser.IValueResourceRepository.

Parameters:
type - the type of resource being scanned
path - the full OS path to the file being parsed
input - the input stream of the XML to be parsed (will be closed by this method)
Returns:
true if parsing succeeds and false if it fails
Throws:
java.io.IOException - if reading the contents fails