|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.android.manifmerger.XmlNode
com.android.manifmerger.OrphanXmlElement
com.android.manifmerger.XmlElement
public class XmlElement
Xml Element
which is mergeable.
A mergeable element can contains 3 types of children :
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.android.manifmerger.XmlNode |
---|
XmlNode.NodeKey, XmlNode.NodeName |
Field Summary |
---|
Fields inherited from class com.android.manifmerger.XmlNode |
---|
NODE_TO_NAME |
Constructor Summary | |
---|---|
XmlElement(org.w3c.dom.Element xml,
XmlDocument document)
|
Method Summary | |
---|---|
com.google.common.base.Optional<java.lang.String> |
compareTo(java.lang.Object other)
Compares this element with another XmlElement ignoring all attributes belonging to
the SdkConstants.TOOLS_URI namespace. |
com.google.common.collect.ImmutableList<XmlElement> |
getAllNodesByType(com.android.manifmerger.ManifestModel.NodeTypes type)
Returns all immediate children of this node for a particular type, irrespective of their key. |
com.google.common.base.Optional<XmlAttribute> |
getAttribute(XmlNode.NodeName attributeName)
Returns the XmlAttribute for an attribute present on this
xml element, or Optional.absent() if not present. |
java.util.Collection<java.util.Map.Entry<XmlNode.NodeName,com.android.manifmerger.AttributeOperationType>> |
getAttributeOperations()
|
com.android.manifmerger.AttributeOperationType |
getAttributeOperationType(XmlNode.NodeName attributeName)
Get the attribute operation type as optionally specified by the user. |
java.util.List<XmlAttribute> |
getAttributes()
Returns the list of attributes for this xml element. |
XmlDocument |
getDocument()
Returns the owning XmlDocument |
com.google.common.collect.ImmutableList<XmlElement> |
getMergeableElements()
|
com.google.common.base.Optional<XmlElement> |
getNodeByTypeAndKey(com.android.manifmerger.ManifestModel.NodeTypes type,
java.lang.String keyValue)
Returns a child of a particular type and a particular key. |
NodeOperationType |
getOperationType()
Get the node operation type as optionally specified by the user. |
java.util.List<Selector> |
getOverrideUsesSdkLibrarySelectors()
|
com.android.utils.PositionXmlParser.Position |
getPosition()
Returns the element's position |
Selector |
getSelector()
Returns a potentially null (if not present) selector decoration on this element. |
XmlLoader.SourceLocation |
getSourceLocation()
Returns the element's document xml source file location. |
boolean |
isEquals(XmlElement otherNode)
|
void |
mergeChildren(XmlElement lowerPriorityNode,
com.android.manifmerger.MergingReport.Builder mergingReport)
|
void |
mergeWithLowerPriorityNode(XmlElement lowerPriorityNode,
com.android.manifmerger.MergingReport.Builder mergingReport)
Merge this xml element with a lower priority node. |
boolean |
supportsSelector()
Returns true if this element supports having a tools:selector decoration, false otherwise. |
Methods inherited from class com.android.manifmerger.OrphanXmlElement |
---|
getId, getKey, getName, getType, getXml, isA |
Methods inherited from class com.android.manifmerger.XmlNode |
---|
fromNSName, fromXmlName, getColumn, getLine, printPosition, printPosition, unwrapName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlElement(@NonNull org.w3c.dom.Element xml, @NonNull XmlDocument document)
Method Detail |
---|
@NonNull public XmlDocument getDocument()
XmlDocument
public java.util.List<XmlAttribute> getAttributes()
public com.google.common.base.Optional<XmlAttribute> getAttribute(XmlNode.NodeName attributeName)
XmlAttribute
for an attribute present on this
xml element, or Optional.absent()
if not present.
attributeName
- the attribute name.public NodeOperationType getOperationType()
NodeOperationType.MERGE
will be returned.
public com.android.manifmerger.AttributeOperationType getAttributeOperationType(XmlNode.NodeName attributeName)
AttributeOperationType.STRICT
will be returned.
public java.util.Collection<java.util.Map.Entry<XmlNode.NodeName,com.android.manifmerger.AttributeOperationType>> getAttributeOperations()
@NonNull public java.util.List<Selector> getOverrideUsesSdkLibrarySelectors()
@NonNull public com.android.utils.PositionXmlParser.Position getPosition()
XmlNode
getPosition
in class OrphanXmlElement
@NonNull public XmlLoader.SourceLocation getSourceLocation()
XmlNode
getSourceLocation
in class OrphanXmlElement
public void mergeWithLowerPriorityNode(XmlElement lowerPriorityNode, com.android.manifmerger.MergingReport.Builder mergingReport)
lowerPriorityNode
- lower priority Xml element to merge with.mergingReport
- the merging report to log errors and actions.public com.google.common.collect.ImmutableList<XmlElement> getMergeableElements()
public com.google.common.base.Optional<XmlElement> getNodeByTypeAndKey(com.android.manifmerger.ManifestModel.NodeTypes type, @Nullable java.lang.String keyValue)
type
- the requested child type.keyValue
- the requested child key.
Optional.absent()
if no child of this
type and key exist.public com.google.common.collect.ImmutableList<XmlElement> getAllNodesByType(com.android.manifmerger.ManifestModel.NodeTypes type)
type
- the type of children element requested.
public void mergeChildren(XmlElement lowerPriorityNode, com.android.manifmerger.MergingReport.Builder mergingReport)
public boolean supportsSelector()
public boolean isEquals(XmlElement otherNode)
@Nullable public Selector getSelector()
public com.google.common.base.Optional<java.lang.String> compareTo(java.lang.Object other)
XmlElement
ignoring all attributes belonging to
the SdkConstants.TOOLS_URI
namespace.
other
- the other element to compare against.
String
describing the differences between the two XML elements or
Optional.absent()
if they are equals.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |