com.android.ide.common.resources
Class ValidatingResourceParser

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

public class ValidatingResourceParser
extends java.lang.Object

Parser for scanning an XML resource file and validating all framework attribute references in it. If an error is found, the associated context is marked as needing a full AAPT run.


Constructor Summary
ValidatingResourceParser(ScanningContext context, boolean isFramework)
          Creates a new ValidatingResourceParser
 
Method Summary
 boolean parse(java.lang.String path, java.io.InputStream input)
          Parse the given input and return false if it contains errors, or if the context is already tagged as needing a full aapt run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatingResourceParser

public ValidatingResourceParser(@NonNull
                                ScanningContext context,
                                boolean isFramework)
Creates a new ValidatingResourceParser

Parameters:
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(java.lang.String path,
                     java.io.InputStream input)
              throws java.io.IOException
Parse the given input and return false if it contains errors, or if the context is already tagged as needing a full aapt run.

Parameters:
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