|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.brics.xact.analysis.soot.TranslatorContext
public class TranslatorContext
Context for producing flow graph statements. This is simple storage with no actual functionality.
Constructor Summary | |
---|---|
TranslatorContext(FlowGraph g,
ErrorHandler errors)
Constructs a new translator context. |
Method Summary | |
---|---|
boolean |
definitelyNonNull(Value v)
|
boolean |
definitelyNull(Value v)
|
String |
expandQName(String qname)
Expands a QName according to the current namespace declarations. |
Map<String,String> |
expandQNames(Map<String,String> qnames)
Expands a QName map according to the current namespace declarations. |
ArrayConstantInfo |
getConstantArray(Value v)
Returns the information known about the specified array variable, if any. |
Origin |
getConstantOrigin(Value v)
Returns the origin constant value for the given Soot value. |
String |
getConstantString(Value v)
Returns the string constant value for the given Soot value or null if it is a null constant. |
SootClass |
getCurrentClass()
Returns the current class. |
int |
getCurrentLine()
Returns the current line number. |
Method |
getCurrentMethod()
|
Origin |
getCurrentOrigin()
Returns the current origin. |
SootMethod |
getCurrentSootMethod()
Returns the current method. |
ErrorHandler |
getErrors()
|
Variable |
getField(SootField field)
|
SchemaType |
getFieldSchemaType(SootField sf)
|
FlowGraph |
getFlowGraph()
|
Hierarchy |
getHierarchy()
Returns the class hierarchy. |
Map<ValueBox,AnalyzeStm> |
getHotspotMap()
Returns the map from soot expression hotspots to their corresponding statements in the flow graph. |
Variable |
getLocal(String name)
|
Method |
getMethod(SootMethod method)
|
String |
getModifiedPackageNameFromClassConstant(Value v)
|
String |
getNamespace(Statement s)
|
Map<String,String> |
getNamespaces()
Returns the namespace declaration map (from prefix to URI). |
int |
getNextVarID()
Returns the next fresh variable ID. |
Variable |
getNothing()
|
String |
getResourceString(String name)
Retrieves a resource string using the current class loader. |
ValueBox |
getStringHotspot1(Statement s)
|
ValueBox |
getStringHotspot2(Statement s)
|
List<SootClass> |
getSubclassesOfIncluding(RefType t)
|
List<SootClass> |
getSubtypesOfIncluding(RefType type)
Returns list of all classes extending or implementing the specified class or interface. |
List<SootClass> |
getSubtypesOfIncluding(SootClass clazz)
Returns list of all classes extending or implementing the specified class or interface. |
String |
getTypeAnnotation(SootField sf)
Returns the Type annotation for a field, or null if not present. |
String |
getTypeAnnotation(SootMethod m)
Returns the Type annotation for a method return, or null if not present. |
String |
getTypeAnnotationForParameter(SootMethod m,
int parameter)
Returns the Type annotation for a method parameter, or null if not present. |
boolean |
hasConstantString(Value v)
|
boolean |
implementsToXMLable(SootClass cl)
|
boolean |
isAnnotatableType(Type t)
Returns true if the specified type can have @Type annotations. |
static boolean |
isStringType(ValueBox b)
Returns an automaton representing the possible string values of the given Soot string expression. |
boolean |
isSubtypeOf(SootClass a,
SootClass b)
Returns true if the first argument is a subtype of the second argument. |
boolean |
isSubtypeOf(SootClass a,
String b)
Returns true if the first argument is a subtype of the class or interface named by the second argument. |
boolean |
isSubtypeOf(Type a,
String b)
Returns true if the first argument is a class or interface that is a subtype of the class or interface named by the second argument. |
boolean |
maybeNonNull(Value v)
|
boolean |
maybeNull(Value v)
|
SchemaType |
parseSchemaType(String annotation,
Origin origin)
|
void |
putHotspot(ValueBox expr,
AnalyzeStm stm)
Marks that the specified soot expression hotspot is being modelled by the specified analyze statement. |
void |
setArrayConstants(ArrayConstantAnalysis arrayConstants)
|
void |
setCurrentClass(SootClass c)
Sets the current class. |
void |
setCurrentLine(int line)
Sets the current line number. |
void |
setCurrentSootMethod(SootMethod m)
Sets the current method. |
void |
setCurrentUnit(Unit unit)
|
void |
setFieldSchemaType(SootField sf,
SchemaType type)
|
void |
setMethod(SootMethod sm,
Method method)
|
void |
setNullness(NullnessAnalysis nullness)
|
void |
setStringConstants(StringConstantAnalysis stringConstants)
|
void |
setStringHotspot(Statement stm,
ValueBox box)
|
void |
setStringHotspot(Statement stm,
ValueBox box1,
ValueBox box2)
|
void |
setStringHotspot(Statement stm,
ValueBox box1,
ValueBox box2,
String namespace)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TranslatorContext(FlowGraph g, ErrorHandler errors)
Method Detail |
---|
public boolean definitelyNonNull(Value v)
public boolean definitelyNull(Value v)
public String expandQName(String qname)
public Map<String,String> expandQNames(Map<String,String> qnames)
public ArrayConstantInfo getConstantArray(Value v)
v
- any value (UNKNOWN is simply returned for non-array variables)
ArrayConstantInfo
,
ArrayConstantAnalysis
public Origin getConstantOrigin(Value v)
XMLAnalysisException
- if the value does not appear to be a constant originpublic String getConstantString(Value v)
XMLAnalysisException
- if the value does not appear to be a constant stringpublic SootClass getCurrentClass()
public int getCurrentLine()
public Method getCurrentMethod()
public Origin getCurrentOrigin()
public SootMethod getCurrentSootMethod()
public ErrorHandler getErrors()
public Variable getField(SootField field)
public SchemaType getFieldSchemaType(SootField sf)
public FlowGraph getFlowGraph()
public Hierarchy getHierarchy()
public Map<ValueBox,AnalyzeStm> getHotspotMap()
public Variable getLocal(String name)
public Method getMethod(SootMethod method)
public String getModifiedPackageNameFromClassConstant(Value v)
public String getNamespace(Statement s)
public Map<String,String> getNamespaces()
public int getNextVarID()
public Variable getNothing()
public String getResourceString(String name)
public ValueBox getStringHotspot1(Statement s)
public ValueBox getStringHotspot2(Statement s)
public List<SootClass> getSubclassesOfIncluding(RefType t)
public List<SootClass> getSubtypesOfIncluding(RefType type)
type
- a class or interface
public List<SootClass> getSubtypesOfIncluding(SootClass clazz)
clazz
- a class or interface
public String getTypeAnnotation(SootField sf)
public String getTypeAnnotation(SootMethod m)
public String getTypeAnnotationForParameter(SootMethod m, int parameter)
public boolean hasConstantString(Value v)
public boolean implementsToXMLable(SootClass cl)
public boolean isAnnotatableType(Type t)
public static boolean isStringType(ValueBox b)
public boolean isSubtypeOf(SootClass a, SootClass b)
public boolean isSubtypeOf(SootClass a, String b)
public boolean isSubtypeOf(Type a, String b)
public boolean maybeNonNull(Value v)
public boolean maybeNull(Value v)
public SchemaType parseSchemaType(String annotation, Origin origin)
public void putHotspot(ValueBox expr, AnalyzeStm stm)
expr
- a hotspot expressionstm
- the corresponding statement in the flow graphpublic void setArrayConstants(ArrayConstantAnalysis arrayConstants)
public void setCurrentClass(SootClass c)
public void setCurrentLine(int line)
public void setCurrentSootMethod(SootMethod m)
public void setCurrentUnit(Unit unit)
public void setFieldSchemaType(SootField sf, SchemaType type)
public void setMethod(SootMethod sm, Method method)
public void setNullness(NullnessAnalysis nullness)
public void setStringConstants(StringConstantAnalysis stringConstants)
public void setStringHotspot(Statement stm, ValueBox box)
public void setStringHotspot(Statement stm, ValueBox box1, ValueBox box2)
public void setStringHotspot(Statement stm, ValueBox box1, ValueBox box2, String namespace)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |