com.android.ide.common.resources
Class ValidatingResourceParser
java.lang.Object
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.
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 |
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 encounteredisFramework
- true if scanning a framework resource
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 parsedinput
- 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