|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.android.manifmerger.XmlDocument
public class XmlDocument
Represents a loaded xml document.
Has pointers to the root XmlElement
element and provides services to persist the document
to an external format. Also provides abilities to be merged with other
XmlDocument
as well as access to the line numbers for all
document's xml elements and attributes.
Constructor Summary | |
---|---|
XmlDocument(com.android.utils.PositionXmlParser positionXmlParser,
XmlLoader.SourceLocation sourceLocation,
KeyResolver<java.lang.String> selectors,
PlaceholderHandler.KeyBasedValueResolver<ManifestMerger2.SystemProperty> systemPropertyResolver,
org.w3c.dom.Element element,
com.android.manifmerger.XmlDocument.Type type,
com.google.common.base.Optional<java.lang.String> mainManifestPackageName)
|
Method Summary | |
---|---|
com.google.common.base.Optional<java.lang.String> |
compareTo(XmlDocument other)
Compares this document to another XmlDocument ignoring all
attributes belonging to the SdkConstants.TOOLS_URI namespace. |
com.google.common.base.Optional<XmlElement> |
getByTypeAndKey(com.android.manifmerger.ManifestModel.NodeTypes type,
java.lang.String keyValue)
|
com.android.manifmerger.XmlDocument.Type |
getFileType()
|
com.google.common.base.Optional<XmlAttribute> |
getPackage()
|
java.lang.String |
getPackageName()
Package name for this android manifest which will be used to resolve partial path. |
java.lang.String |
getPackageNameForAttributeExpansion()
Returns the package name to use to expand the attributes values with the document's package name |
XmlElement |
getRootNode()
|
KeyResolver<java.lang.String> |
getSelectors()
Returns a KeyResolver capable of resolving all selectors
types |
XmlLoader.SourceLocation |
getSourceLocation()
|
PlaceholderHandler.KeyBasedValueResolver<ManifestMerger2.SystemProperty> |
getSystemPropertyResolver()
Returns the PlaceholderHandler.KeyBasedValueResolver capable
of resolving all injected ManifestMerger2.SystemProperty |
org.w3c.dom.Document |
getXml()
|
com.google.common.base.Optional<XmlDocument> |
merge(XmlDocument lowerPriorityDocument,
com.android.manifmerger.MergingReport.Builder mergingReportBuilder)
merge this higher priority document with a higher priority document. |
java.lang.String |
prettyPrint()
Returns a pretty string representation of this document. |
XmlDocument |
reparse()
Forces a re-parsing of the document |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlDocument(@NonNull com.android.utils.PositionXmlParser positionXmlParser, @NonNull XmlLoader.SourceLocation sourceLocation, @NonNull KeyResolver<java.lang.String> selectors, @NonNull PlaceholderHandler.KeyBasedValueResolver<ManifestMerger2.SystemProperty> systemPropertyResolver, @NonNull org.w3c.dom.Element element, @NonNull com.android.manifmerger.XmlDocument.Type type, @NonNull com.google.common.base.Optional<java.lang.String> mainManifestPackageName)
Method Detail |
---|
public com.android.manifmerger.XmlDocument.Type getFileType()
public java.lang.String prettyPrint()
public com.google.common.base.Optional<XmlDocument> merge(XmlDocument lowerPriorityDocument, com.android.manifmerger.MergingReport.Builder mergingReportBuilder)
lowerPriorityDocument
- the lower priority document to merge in.mergingReportBuilder
- the merging report to record errors and actions.
XmlDocument
or
Optional.absent()
if there were errors during the merging activities.public XmlDocument reparse()
XmlDocument
with up to date information.public KeyResolver<java.lang.String> getSelectors()
KeyResolver
capable of resolving all selectors
types
public PlaceholderHandler.KeyBasedValueResolver<ManifestMerger2.SystemProperty> getSystemPropertyResolver()
PlaceholderHandler.KeyBasedValueResolver
capable
of resolving all injected ManifestMerger2.SystemProperty
public com.google.common.base.Optional<java.lang.String> compareTo(XmlDocument other)
XmlDocument
ignoring all
attributes belonging to the SdkConstants.TOOLS_URI
namespace.
other
- the other document to compare against.
String
describing the differences between the two XML elements or
Optional.absent()
if they are equals.@NonNull public XmlLoader.SourceLocation getSourceLocation()
public XmlElement getRootNode()
public com.google.common.base.Optional<XmlElement> getByTypeAndKey(com.android.manifmerger.ManifestModel.NodeTypes type, @Nullable java.lang.String keyValue)
public java.lang.String getPackageName()
public java.lang.String getPackageNameForAttributeExpansion()
public com.google.common.base.Optional<XmlAttribute> getPackage()
public org.w3c.dom.Document getXml()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |