@Immutable
public class ManifestModel
extends java.lang.Object
implements com.android.manifmerger.DocumentModel<com.android.manifmerger.ManifestModel.NodeTypes>
This model will describe each element that is eligible for merging and associated merging policies. It is not reusable as most of its interfaces are private but a future enhancement could easily make this more generic/reusable if we need to merge more than manifest files.
| Constructor and Description |
|---|
ManifestModel()
Creates a DocumentModel to be used for merging Android manifest documents
|
ManifestModel(boolean autoReject)
Creates a DocumentModel to be used for merging Android manifest documents
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
autoRejectConflicts() |
com.android.manifmerger.ManifestModel.NodeTypes |
fromXmlSimpleName(java.lang.String xmlSimpleName)
Returns the
NodeTypes instance from an xml element name (without namespace
decoration). |
java.lang.String |
toXmlName(com.android.manifmerger.ManifestModel.NodeTypes type)
Returns the Xml name for this node type
|
public ManifestModel()
public ManifestModel(boolean autoReject)
autoReject - specifies whether model can ignore conflicts in attribute values when
merging manifest documents and simply reject value from the lower priority documentpublic java.lang.String toXmlName(@NonNull
com.android.manifmerger.ManifestModel.NodeTypes type)
toXmlName in interface com.android.manifmerger.DocumentModel<com.android.manifmerger.ManifestModel.NodeTypes>public com.android.manifmerger.ManifestModel.NodeTypes fromXmlSimpleName(java.lang.String xmlSimpleName)
NodeTypes instance from an xml element name (without namespace
decoration). For instance, an xml element
<activity android:name="foo">
...
</activity>
has a xml simple name of "activity" which will resolve to NodeTypes#ACTIVITY value.
Note : a runtime exception will be generated if no mapping from the simple name to a
ManifestModel.NodeTypes exists.
fromXmlSimpleName in interface com.android.manifmerger.DocumentModel<com.android.manifmerger.ManifestModel.NodeTypes>xmlSimpleName - the xml (lower-hyphen separated words) simple name.NodeTypes associated with that element name.public boolean autoRejectConflicts()
autoRejectConflicts in interface com.android.manifmerger.DocumentModel<com.android.manifmerger.ManifestModel.NodeTypes>