com.android.manifmerger
Class Actions

java.lang.Object
  extended by com.android.manifmerger.Actions

@Immutable
public class Actions
extends java.lang.Object

Contains all actions taken during a merging invocation.


Nested Class Summary
static class Actions.ActionLocation
          Defines an action location which is composed of a pointer to the source location (e.g.
static class Actions.AttributeRecord
          Defines a merging tool action for an xml attribute
static class Actions.NodeRecord
          Defines a merging tool action for an xml element.
static class Actions.Record
          Defines an abstract record contain common metadata for elements and attributes actions.
 
Constructor Summary
Actions(com.google.common.collect.ImmutableMap<XmlNode.NodeKey,com.android.manifmerger.Actions.DecisionTreeRecord> records)
           
 
Method Summary
 java.lang.String blame(XmlDocument xmlDocument)
           
 com.google.common.collect.ImmutableList<Actions.AttributeRecord> getAttributeRecords(XmlNode.NodeKey elementKey, XmlNode.NodeName attributeName)
          Returns the ImmutableList of Actions.AttributeRecord for the attribute identified by attributeName of the element identified by elementKey.
 com.google.common.collect.ImmutableSet<XmlNode.NodeKey> getNodeKeys()
          Returns a ImmutableSet of all the element's keys that have at least one Actions.NodeRecord.
 com.google.common.collect.ImmutableList<Actions.NodeRecord> getNodeRecords(org.w3c.dom.Element element)
          Returns a ImmutableList of Actions.NodeRecords for the passed xml Element
 com.google.common.collect.ImmutableList<Actions.NodeRecord> getNodeRecords(XmlNode.NodeKey key)
          Returns an ImmutableList of Actions.NodeRecord for the element identified with the passed key.
 com.google.common.collect.ImmutableList<XmlNode.NodeName> getRecordedAttributeNames(XmlNode.NodeKey nodeKey)
          Returns a ImmutableList of all attributes names that have at least one record for the element identified with the passed key.
 com.google.common.collect.ImmutableMultimap<java.lang.Integer,Actions.Record> getResultingSourceMapping(XmlDocument xmlDocument)
           
static Actions load(java.io.InputStream inputStream)
           
static Actions load(java.lang.String xml)
           
 java.lang.String persist()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Actions

public Actions(com.google.common.collect.ImmutableMap<XmlNode.NodeKey,com.android.manifmerger.Actions.DecisionTreeRecord> records)
Method Detail

getNodeRecords

@NonNull
public com.google.common.collect.ImmutableList<Actions.NodeRecord> getNodeRecords(org.w3c.dom.Element element)
Returns a ImmutableList of Actions.NodeRecords for the passed xml Element

Returns:
the node records for that element or an empty list if none exist.

getNodeKeys

@NonNull
public com.google.common.collect.ImmutableSet<XmlNode.NodeKey> getNodeKeys()
Returns a ImmutableSet of all the element's keys that have at least one Actions.NodeRecord.


getNodeRecords

@NonNull
public com.google.common.collect.ImmutableList<Actions.NodeRecord> getNodeRecords(XmlNode.NodeKey key)
Returns an ImmutableList of Actions.NodeRecord for the element identified with the passed key.


getRecordedAttributeNames

@NonNull
public com.google.common.collect.ImmutableList<XmlNode.NodeName> getRecordedAttributeNames(XmlNode.NodeKey nodeKey)
Returns a ImmutableList of all attributes names that have at least one record for the element identified with the passed key.


getAttributeRecords

@NonNull
public com.google.common.collect.ImmutableList<Actions.AttributeRecord> getAttributeRecords(XmlNode.NodeKey elementKey,
                                                                                                    XmlNode.NodeName attributeName)
Returns the ImmutableList of Actions.AttributeRecord for the attribute identified by attributeName of the element identified by elementKey.


persist

public java.lang.String persist()
                         throws javax.xml.parsers.ParserConfigurationException,
                                java.io.IOException,
                                org.xml.sax.SAXException
Throws:
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException

load

@Nullable
public static Actions load(java.io.InputStream inputStream)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           javax.xml.parsers.ParserConfigurationException
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

load

@Nullable
public static Actions load(java.lang.String xml)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           javax.xml.parsers.ParserConfigurationException
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

getResultingSourceMapping

public com.google.common.collect.ImmutableMultimap<java.lang.Integer,Actions.Record> getResultingSourceMapping(XmlDocument xmlDocument)
                                                                                                        throws javax.xml.parsers.ParserConfigurationException,
                                                                                                               org.xml.sax.SAXException,
                                                                                                               java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

blame

public java.lang.String blame(XmlDocument xmlDocument)
                       throws java.io.IOException,
                              org.xml.sax.SAXException,
                              javax.xml.parsers.ParserConfigurationException
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException