soot.jimple.infoflow.android.axml.AXmlDocument Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of soot-infoflow-android Show documentation
Show all versions of soot-infoflow-android Show documentation
Android-specific components of FlowDroid
package soot.jimple.infoflow.android.axml;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* Class representing a document in the Android XML format
*
* @author Steven Arzt
*/
public class AXmlDocument {
/**
* The root node of the document
*/
private AXmlNode rootNode;
/**
* The namespaces registered on this element.
*/
Map namespaces = null;
/**
* Gets the root node of this Android XML document
*
* @return The root node of this Android XML document
*/
public AXmlNode getRootNode() {
return this.rootNode;
}
/**
* Sets the root node of this document
*
* @param rootNode The new root node of this document
*/
public void setRootNode(AXmlNode rootNode) {
this.rootNode = rootNode;
}
/**
* Adds a namespace that is defined in this node.
*
* @param ns The namespace defined in this node.
*/
public void addNamespace(AXmlNamespace ns) {
// Do not add the default namespace
if (ns.getUri() == null || ns.getUri().isEmpty())
return;
if (this.namespaces == null)
this.namespaces = new HashMap();
this.namespaces.put(ns.getPrefix(), ns);
}
/**
* Gets all namespaces registered in this document
*
* @return A collection of all namespaces registered in this document
*/
public Collection getNamespaces() {
return this.namespaces == null ? Collections.emptySet() : this.namespaces.values();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy