public class PreValidator
extends java.lang.Object
XmlDocument and check for potential inconsistencies in the model due
to user error or omission.
This is implemented as a separate class so it can be invoked by tools independently from the
merging process.
This validator will check the state of the loaded xml document before any merging activity is
attempted. It verifies things like a "tools:replace="foo" attribute has a "android:foo"
attribute also declared on the same element (since we want to replace its value).| Modifier and Type | Method and Description |
|---|---|
static MergingReport.Result |
validate(com.android.manifmerger.MergingReport.Builder mergingReport,
XmlDocument xmlDocument)
Validates a loaded
XmlDocument and return a status of the
merging model. |
@NonNull public static MergingReport.Result validate(@NonNull com.android.manifmerger.MergingReport.Builder mergingReport, @NonNull XmlDocument xmlDocument)
XmlDocument and return a status of the
merging model.
Will return one the following status :
MergingReport.Result.SUCCESS : the merging model is
correct, merging should be attemptedMergingReport.Result.WARNING : the merging model
contains non fatal error, user should be notified, merging can be attemptedMergingReport.Result.ERROR : the merging model
contains errors, user must be notified, merging should not be attemptedSdkConstants.TOOLS_URI instructions are correct and consistent.mergingReport - report to log warnings and errors.xmlDocument - the loaded xml part.MergingReport.Result value.