Class XMLSourceSinkParser
java.lang.Object
soot.jimple.infoflow.android.source.parsers.xml.AbstractXMLSourceSinkParser
soot.jimple.infoflow.android.source.parsers.xml.XMLSourceSinkParser
- All Implemented Interfaces:
ISourceSinkDefinitionProvider
public class XMLSourceSinkParser
extends AbstractXMLSourceSinkParser
implements ISourceSinkDefinitionProvider
Parses informations from the new Dataformat (XML) with the help of SAX.
Returns only a Set of Android Method when calling the function parse. For the
AccessPath the class SaxHandler is used.
- Author:
- Anna-Katharina Wickert, Joern Tillmans, Steven Arzt, Niklas Vogel
-
Nested Class Summary
Nested classes/interfaces inherited from class soot.jimple.infoflow.android.source.parsers.xml.AbstractXMLSourceSinkParser
AbstractXMLSourceSinkParser.ICategoryFilter, AbstractXMLSourceSinkParser.SAXHandler -
Field Summary
FieldsFields inherited from class soot.jimple.infoflow.android.source.parsers.xml.AbstractXMLSourceSinkParser
categories, categoryFilter, sinks, sources, sourcesAndSinks -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedXMLSourceSinkParser(AbstractXMLSourceSinkParser.ICategoryFilter categoryFilter) Creates a new instance of theXMLSourceSinkParserclass -
Method Summary
Modifier and TypeMethodDescriptionprotected voidBuilds the lists of sources and sinks from the data that we have parsedprotected IAccessPathBasedSourceSinkDefinitioncreateFieldSourceSinkDefinition(String signature, Set<AccessPathTuple> baseAPs) Factory method forFieldSourceSinkDefinitioninstancesprotected IAccessPathBasedSourceSinkDefinitioncreateFieldSourceSinkDefinition(String signature, Set<AccessPathTuple> baseAPs, Set<SourceSinkCondition> conditions) Factory method forFieldSourceSinkDefinitioninstancesprotected ISourceSinkDefinitioncreateMethodSourceSinkDefinition(AbstractMethodAndClass method, Set<AccessPathTuple> baseAPs, Set<AccessPathTuple>[] paramAPs, Set<AccessPathTuple> returnAPs, MethodSourceSinkDefinition.CallType callType, ISourceSinkCategory category) Factory method forMethodSourceSinkDefinitioninstancesprotected ISourceSinkDefinitioncreateMethodSourceSinkDefinition(AbstractMethodAndClass method, Set<AccessPathTuple> baseAPs, Set<AccessPathTuple>[] paramAPs, Set<AccessPathTuple> returnAPs, MethodSourceSinkDefinition.CallType callType, ISourceSinkCategory category, Set<SourceSinkCondition> conditions) Factory method forMethodSourceSinkDefinitioninstancesstatic XMLSourceSinkParserstatic XMLSourceSinkParserfromFile(File file, AbstractXMLSourceSinkParser.ICategoryFilter categoryFilter) static XMLSourceSinkParserstatic XMLSourceSinkParserfromFile(String fileName, AbstractXMLSourceSinkParser.ICategoryFilter categoryFilter) static XMLSourceSinkParserfromStream(InputStream inputStream) static XMLSourceSinkParserfromStream(InputStream inputStream, AbstractXMLSourceSinkParser.ICategoryFilter categoryFilter) protected static InputStreamprotected voidrunParse(SAXParser parser, InputStream stream) Run parse method on given parserMethods inherited from class soot.jimple.infoflow.android.source.parsers.xml.AbstractXMLSourceSinkParser
addSourceSinkDefinition, addSourceSinkDefinition, getAllMethods, getSinks, getSources, parseInputStream, parseSignatureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface soot.jimple.infoflow.sourcesSinks.definitions.ISourceSinkDefinitionProvider
getAllMethods, getSinks, getSources
-
Field Details
-
XSD_FILE_PATH
- See Also:
-
W3C_XML_SCHEMA
- See Also:
-
-
Constructor Details
-
XMLSourceSinkParser
Creates a new instance of theXMLSourceSinkParserclass- Parameters:
filter- A filter for excluding certain categories of sources and sinks
-
-
Method Details
-
fromFile
- Throws:
IOException
-
fromFile
- Throws:
IOException
-
fromFile
public static XMLSourceSinkParser fromFile(String fileName, AbstractXMLSourceSinkParser.ICategoryFilter categoryFilter) throws IOException - Throws:
IOException
-
fromFile
public static XMLSourceSinkParser fromFile(File file, AbstractXMLSourceSinkParser.ICategoryFilter categoryFilter) throws IOException - Throws:
IOException
-
getStream
- Throws:
IOException
-
fromStream
- Throws:
IOException
-
fromStream
public static XMLSourceSinkParser fromStream(InputStream inputStream, AbstractXMLSourceSinkParser.ICategoryFilter categoryFilter) throws IOException - Throws:
IOException
-
buildSourceSinkLists
protected void buildSourceSinkLists()Builds the lists of sources and sinks from the data that we have parsed- Specified by:
buildSourceSinkListsin classAbstractXMLSourceSinkParser
-
createMethodSourceSinkDefinition
protected ISourceSinkDefinition createMethodSourceSinkDefinition(AbstractMethodAndClass method, Set<AccessPathTuple> baseAPs, Set<AccessPathTuple>[] paramAPs, Set<AccessPathTuple> returnAPs, MethodSourceSinkDefinition.CallType callType, ISourceSinkCategory category) Factory method forMethodSourceSinkDefinitioninstances- Specified by:
createMethodSourceSinkDefinitionin classAbstractXMLSourceSinkParser- Parameters:
method- The method that is to be defined as a source or sinkbaseAPs- The access paths rooted in the base object that shall be considered as sources or sinksparamAPs- The access paths rooted in parameters that shall be considered as sources or sinks. The index in the set corresponds to the index of the formal parameter to which the respective set of access paths belongs.returnAPs- The access paths rooted in the return object that shall be considered as sources or sinkscallType- The type of call (normal call, callback, etc.)- Returns:
- The newly created
MethodSourceSinkDefinitioninstance
-
createMethodSourceSinkDefinition
protected ISourceSinkDefinition createMethodSourceSinkDefinition(AbstractMethodAndClass method, Set<AccessPathTuple> baseAPs, Set<AccessPathTuple>[] paramAPs, Set<AccessPathTuple> returnAPs, MethodSourceSinkDefinition.CallType callType, ISourceSinkCategory category, Set<SourceSinkCondition> conditions) Description copied from class:AbstractXMLSourceSinkParserFactory method forMethodSourceSinkDefinitioninstances- Specified by:
createMethodSourceSinkDefinitionin classAbstractXMLSourceSinkParser- Parameters:
method- The method that is to be defined as a source or sinkbaseAPs- The access paths rooted in the base object that shall be considered as sources or sinksparamAPs- The access paths rooted in parameters that shall be considered as sources or sinks. The index in the set corresponds to the index of the formal parameter to which the respective set of access paths belongs.returnAPs- The access paths rooted in the return object that shall be considered as sources or sinkscallType- The type of call (normal call, callback, etc.)conditions- Conditions which has to be true for the definition to be valid- Returns:
- The newly created
MethodSourceSinkDefinitioninstance
-
createFieldSourceSinkDefinition
protected IAccessPathBasedSourceSinkDefinition createFieldSourceSinkDefinition(String signature, Set<AccessPathTuple> baseAPs) Factory method forFieldSourceSinkDefinitioninstances- Specified by:
createFieldSourceSinkDefinitionin classAbstractXMLSourceSinkParser- Parameters:
signature- The signature of the target fieldbaseAPs- The access paths that shall be considered as sources or sinks- Returns:
- The newly created
FieldSourceSinkDefinitioninstance
-
createFieldSourceSinkDefinition
protected IAccessPathBasedSourceSinkDefinition createFieldSourceSinkDefinition(String signature, Set<AccessPathTuple> baseAPs, Set<SourceSinkCondition> conditions) Description copied from class:AbstractXMLSourceSinkParserFactory method forFieldSourceSinkDefinitioninstances- Specified by:
createFieldSourceSinkDefinitionin classAbstractXMLSourceSinkParser- Parameters:
signature- The signature of the target fieldbaseAPs- The access paths that shall be considered as sources or sinksconditions- Conditions which has to be true for the definition to be valid- Returns:
- The newly created
FieldSourceSinkDefinitioninstance
-
runParse
Run parse method on given parser- Specified by:
runParsein classAbstractXMLSourceSinkParser- Parameters:
parser- The parser which should be used to parsestream- The XML text input stream which should be parsed
-