Package soot.dotnet.members
Class DotnetMethod
- java.lang.Object
-
- soot.dotnet.members.AbstractDotnetMember
-
- soot.dotnet.members.DotnetMethod
-
- All Implemented Interfaces:
DotnetTypeMember
public class DotnetMethod extends AbstractDotnetMember
Represents a .NET Method SourceLocator -> ClassProvider -> ClassSource -> MethodSource (DotnetMethod)
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONSTRUCTOR_NAMEstatic StringDESTRUCTOR_NAMEstatic StringJAVA_CONSTRUCTOR_NAMEstatic StringJAVA_STATIC_CONSTRUCTOR_NAMEstatic StringMAIN_METHOD_SIGNATUREstatic StringSTATIC_CONSTRUCTOR_NAME
-
Constructor Summary
Constructors Constructor Description DotnetMethod(ProtoAssemblyAllTypes.MethodDefinition protoMethod)DotnetMethod(ProtoAssemblyAllTypes.MethodDefinition protoMethod, SootClass declaringClass)DotnetMethod(ProtoAssemblyAllTypes.MethodDefinition protoMethod, SootClass declaringClass, soot.dotnet.members.DotnetMethod.DotnetMethodType declaringMemberType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringconvertCtorName(String methodName)Convert Dotnet/CLI constructor names to java byte code constructors, if availableSootClassgetDeclaringClass()StringgetName()List<ProtoAssemblyAllTypes.ParameterDefinition>getParameterDefinitions()Get parameters of this MethodProtoAssemblyAllTypes.MethodDefinitiongetProtoMessage()ProtoAssemblyAllTypes.TypeDefinitiongetReturnType()SootMethodgetSootMethodSignature()StringgetUniqueName()Process Name Mangling to achieve a unique name in the declared class Convert method name to a unique method name if it has generics or call-by-ref as parametersbooleanhasCallByRefParameters()Check if this method contains call-by-ref parameters (e.g.booleanhasCilPrimitiveParameters()Check whether this method contains CIL primitives, such as uint sbytebooleanhasGenericParameters()Check whether this method has generics or call-by-ref parametersbooleanisConstructor()booleanisStatic()BodyjimplifyMethodBody(ProtoIlInstructions.IlFunctionMsg ilFunctionMsg)Generate Jimple Body of this MethodSootMethodtoSootMethod()Create a SootMethod of this .NET MethodSootMethodtoSootMethod(MethodSource methodSource)Create SootMethod with specific MethodSource (used by Events and Properties) Events and Properties have other sources for method bodies-
Methods inherited from class soot.dotnet.members.AbstractDotnetMember
checkRewriteCilSpecificMember
-
-
-
-
Field Detail
-
STATIC_CONSTRUCTOR_NAME
public static final String STATIC_CONSTRUCTOR_NAME
- See Also:
- Constant Field Values
-
CONSTRUCTOR_NAME
public static final String CONSTRUCTOR_NAME
- See Also:
- Constant Field Values
-
JAVA_STATIC_CONSTRUCTOR_NAME
public static final String JAVA_STATIC_CONSTRUCTOR_NAME
- See Also:
- Constant Field Values
-
JAVA_CONSTRUCTOR_NAME
public static final String JAVA_CONSTRUCTOR_NAME
- See Also:
- Constant Field Values
-
DESTRUCTOR_NAME
public static final String DESTRUCTOR_NAME
- See Also:
- Constant Field Values
-
MAIN_METHOD_SIGNATURE
public static final String MAIN_METHOD_SIGNATURE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DotnetMethod
public DotnetMethod(ProtoAssemblyAllTypes.MethodDefinition protoMethod, SootClass declaringClass, soot.dotnet.members.DotnetMethod.DotnetMethodType declaringMemberType)
-
DotnetMethod
public DotnetMethod(ProtoAssemblyAllTypes.MethodDefinition protoMethod, SootClass declaringClass)
-
DotnetMethod
public DotnetMethod(ProtoAssemblyAllTypes.MethodDefinition protoMethod)
-
-
Method Detail
-
isConstructor
public boolean isConstructor()
-
isStatic
public boolean isStatic()
-
getProtoMessage
public ProtoAssemblyAllTypes.MethodDefinition getProtoMessage()
-
getName
public String getName()
-
getReturnType
public ProtoAssemblyAllTypes.TypeDefinition getReturnType()
-
toSootMethod
public SootMethod toSootMethod()
Create a SootMethod of this .NET Method- Returns:
-
toSootMethod
public SootMethod toSootMethod(MethodSource methodSource)
Create SootMethod with specific MethodSource (used by Events and Properties) Events and Properties have other sources for method bodies- Parameters:
methodSource-- Returns:
-
jimplifyMethodBody
public Body jimplifyMethodBody(ProtoIlInstructions.IlFunctionMsg ilFunctionMsg)
Generate Jimple Body of this Method- Parameters:
ilFunctionMsg- ProtoMsg Method Body- Returns:
-
getParameterDefinitions
public List<ProtoAssemblyAllTypes.ParameterDefinition> getParameterDefinitions()
Get parameters of this Method- Returns:
-
getDeclaringClass
public SootClass getDeclaringClass()
-
getSootMethodSignature
public SootMethod getSootMethodSignature()
-
hasCallByRefParameters
public boolean hasCallByRefParameters()
Check if this method contains call-by-ref parameters (e.g. MyMethod(param1&))- Returns:
- bool
-
hasGenericParameters
public boolean hasGenericParameters()
Check whether this method has generics or call-by-ref parameters- Returns:
- bool
-
hasCilPrimitiveParameters
public boolean hasCilPrimitiveParameters()
Check whether this method contains CIL primitives, such as uint sbyte- Returns:
-
getUniqueName
public String getUniqueName()
Process Name Mangling to achieve a unique name in the declared class Convert method name to a unique method name if it has generics or call-by-ref as parameters- Returns:
- unique name
-
-