Class Signature
java.lang.Object
org.glassfish.pfl.dynamic.codegen.spi.Signature
Represents the signature of a method, which is sometimes needed
for selecting the correct method.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionargTypes()
private void
checkArgTypeCompatibility
(List<Type> atypes) private boolean
checkArgTypeCompatibility
(List<Type> atypes, boolean throwsException) void
checkCompatibility
(Type targetType, String ident, List<Expression> args) Check whether the list of expression in args is statically compatible with this Signature.private void
checkCompatibility
(Type targetType, String ident, List<Expression> args, boolean isStaticMethod) void
checkConstructorCompatibility
(Type targetType, List<Expression> args) Check whether the list of expression in args is statically compatible with this Signature.void
checkStaticCompatibility
(Type targetType, String ident, List<Expression> args) Check whether the list of expression in args is statically compatible with this Signature.displayAsMethod
(String methodName) boolean
static Signature
fromCall
(Type type, String ident, List<Expression> exprs) static Signature
fromCallUsingTypes
(Type type, String ident, List<Type> types) static Signature
fromConstructor
(Type type, List<Expression> exprs) static Signature
fromConstructorUsingTypes
(Type type, List<Type> types) private static Signature
fromMethodCall
(Type type, String ident, List<Expression> exprs, boolean isStaticCall) private static Signature
fromMethodCallUsingTypes
(Type type, String ident, List<Type> types, boolean isStaticCall) static Signature
fromStaticCall
(Type type, String ident, List<Expression> exprs) static Signature
fromStaticCallUsingTypes
(Type type, String ident, List<Type> types) private static String
getCallTypeString
(Signature.CallType ct, String ident) private static ClassInfo
getClassInfo
(Type type) private static Set
<MethodInfo> getCompatibleMethods
(Set<MethodInfo> methods, List<Type> argTypes) getExprTypes
(List<Expression> exprs) private static String
getMethodListString
(Set<MethodInfo> mlist) private static Set
<MethodInfo> getMethods
(Type type, String ident, boolean staticOnly) private static String
getTypeListString
(List<Type> types) int
hashCode()
static Signature
private static MethodInfo
returnCompatibleMethod
(Type type, String ident, List<Type> argTypes, Signature.CallType ctype, Set<MethodInfo> compatibleMethods) private static String
toString()
-
Field Details
-
rtype
-
types
-
signature
-
-
Constructor Details
-
Signature
-
-
Method Details
-
make
-
returnType
-
argTypes
-
hashCode
public int hashCode() -
toString
-
signature
-
displayAsMethod
-
displayAsMethod
-
equals
-
checkArgTypeCompatibility
-
checkArgTypeCompatibility
-
getExprTypes
-
getClassInfo
-
checkCompatibility
private void checkCompatibility(Type targetType, String ident, List<Expression> args, boolean isStaticMethod) -
checkCompatibility
Check whether the list of expression in args is statically compatible with this Signature. This means that args and this.types have the same length, and the type of each expression in args is assignment compatible with the corresponding types in this.types. Also, the targetType must actually contain a non-static method of the appropriate signature and name.- Throws:
IllegalArgumentException
- if args is not compatible with this.types.
-
checkStaticCompatibility
Check whether the list of expression in args is statically compatible with this Signature. This means that args and this.types have the same length, and the type of each expression in args is assignment compatible with the corresponding types in this.types. Also, the targetType must actually contain a static method of the appropriate signature and name.- Throws:
IllegalArgumentException
- if args is not compatible with this.types.
-
checkConstructorCompatibility
Check whether the list of expression in args is statically compatible with this Signature. This means that args and this.types have the same length, and the type of each expression in args is assignment compatible with the corresponding types in this.types. Also, the targetType must actually contain a constructor of the appropriate signature and name.- Throws:
IllegalArgumentException
- if args is not compatible with this.types.
-
getMethods
-
getCompatibleMethods
-
sprintf
-
getCallTypeString
-
getTypeListString
-
getMethodListString
-
returnCompatibleMethod
private static MethodInfo returnCompatibleMethod(Type type, String ident, List<Type> argTypes, Signature.CallType ctype, Set<MethodInfo> compatibleMethods) -
fromMethodCallUsingTypes
-
fromMethodCall
private static Signature fromMethodCall(Type type, String ident, List<Expression> exprs, boolean isStaticCall) -
fromCall
-
fromCallUsingTypes
-
fromStaticCall
-
fromStaticCallUsingTypes
-
fromConstructorUsingTypes
-
fromConstructor
-