com.android.manifmerger
Class PreValidator

java.lang.Object
  extended by com.android.manifmerger.PreValidator

public class PreValidator
extends java.lang.Object

Validates a loaded 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).


Method Summary
static MergingReport.Result validate(com.android.manifmerger.MergingReport.Builder mergingReport, XmlDocument xmlDocument)
          Validates a loaded XmlDocument and return a status of the merging model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

validate

@NonNull
public static MergingReport.Result validate(@NonNull
                                                    com.android.manifmerger.MergingReport.Builder mergingReport,
                                                    @NonNull
                                                    XmlDocument xmlDocument)
Validates a loaded XmlDocument and return a status of the merging model. Will return one the following status : A successful validation does not mean that the merging will be successful, it only means that the SdkConstants.TOOLS_URI instructions are correct and consistent.

Parameters:
mergingReport - report to log warnings and errors.
xmlDocument - the loaded xml part.
Returns:
one the MergingReport.Result value.