Package com.android.manifmerger
Class PlaceholderHandler
java.lang.Object
com.android.manifmerger.PlaceholderHandler
Replaces all placeholders of the form ${name} with a tool invocation provided value
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface to provide a value for a placeholder key. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPlaceHolder(String string) Returns true if the passed string is a placeholder value, false otherwise.static voidvisit(MergingReport.Record.Severity severity, XmlDocument xmlDocument, PlaceholderHandler.KeyBasedValueResolver<String> valueProvider, MergingReport.Builder mergingReportBuilder) Visits a document's entire tree and check each attribute for a placeholder existence.
-
Field Details
-
INSTRUMENTATION_RUNNER
- See Also:
-
PACKAGE_NAME
- See Also:
-
APPLICATION_ID
- See Also:
-
FEATURE_NAME
- See Also:
-
-
Constructor Details
-
PlaceholderHandler
public PlaceholderHandler()
-
-
Method Details
-
isPlaceHolder
Returns true if the passed string is a placeholder value, false otherwise. -
visit
public static void visit(@NonNull MergingReport.Record.Severity severity, @NonNull XmlDocument xmlDocument, @NonNull PlaceholderHandler.KeyBasedValueResolver<String> valueProvider, @NonNull MergingReport.Builder mergingReportBuilder) Visits a document's entire tree and check each attribute for a placeholder existence. If one is found, delegate to the providedPlaceholderHandler.KeyBasedValueResolverto provide a value for the placeholder.If no value is provided, an error will be generated.
- Parameters:
severity- the severity of recorded messages regarding placeholders being found without corresponding values.xmlDocument- the xml document to visitvalueProvider- the placeholder value provider.mergingReportBuilder- to report errors and log actions.
-