|
||||||||
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,
org.w3c.dom.Element element)
|
Method Summary | |
---|---|
void |
addImplicitElements(XmlDocument lowerPriorityDocument,
com.android.manifmerger.MergingReport.Builder mergingReport)
Add all implicit elements from the passed lower priority document that are required in the target SDK. |
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)
|
int |
getMinSdkVersion()
|
java.lang.String |
getPackageName()
|
XmlElement |
getRootNode()
|
KeyResolver<java.lang.String> |
getSelectors()
Returns a KeyResolver capable of resolving all selectors
types |
XmlLoader.SourceLocation |
getSourceLocation()
|
int |
getTargetSdkVersion()
|
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 org.w3c.dom.Element element)
Method Detail |
---|
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 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.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 org.w3c.dom.Document getXml()
public int getMinSdkVersion()
public int getTargetSdkVersion()
public void addImplicitElements(XmlDocument lowerPriorityDocument, com.android.manifmerger.MergingReport.Builder mergingReport)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |