com.android.manifmerger
Class PlaceholderHandler
java.lang.Object
com.android.manifmerger.PlaceholderHandler
public class PlaceholderHandler
- extends java.lang.Object
Replaces all placeholders of the form ${name} with a tool invocation provided value
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PlaceholderHandler
public PlaceholderHandler()
isPlaceHolder
public static boolean isPlaceHolder(@NonNull
java.lang.String string)
- Returns true if the passed string is a placeholder value, false otherwise.
visit
public void visit(@NonNull
ManifestMerger2.MergeType mergeType,
@NonNull
XmlDocument xmlDocument,
@NonNull
PlaceholderHandler.KeyBasedValueResolver<java.lang.String> valueProvider,
@NonNull
com.android.manifmerger.MergingReport.Builder mergingReportBuilder)
- Visits a document's entire tree and check each attribute for a placeholder existence.
If one is found, delegate to the provided
PlaceholderHandler.KeyBasedValueResolver
to provide a value
for the placeholder.
If no value is provided, an error will be generated.
- Parameters:
xmlDocument
- the xml document to visitvalueProvider
- the placeholder value provider.mergingReportBuilder
- to report errors and log actions.