Package sootup.core
Interface IdentifierFactory
- All Known Implementing Classes:
JavaIdentifierFactory,JavaModuleIdentifierFactory
public interface IdentifierFactory
A factory used for creating language-specific objects representing entities of the language, for
instance
PackageName, MethodSignature and others.-
Method Summary
Modifier and TypeMethodDescriptiongetArrayType(Type baseType, int dim) Gets the array type.@NonNull PrimitiveTypeGet thebooleanprimitive type.@NonNull ClassTypegetBoxedType(@NonNull PrimitiveType primitiveType) Get the ClassType for the boxed primitiveType.@NonNull PrimitiveTypeGet thebooleanprimitive type.@NonNull PrimitiveTypeGet thecharprimitive type.getClassType(String fullyQualifiedClassName) Gets the class type.getClassType(String className, String packageName) Gets the class type.@NonNull PrimitiveTypeGet thedoubleprimitive type.@NonNull FieldSignaturegetFieldSignature(@NonNull ClassType declaringClassSignature, @NonNull FieldSubSignature subSignature) Gets the field signature.getFieldSignature(String fieldName, ClassType declaringClassSignature, String fieldType) Gets the field signature.getFieldSignature(String fieldName, ClassType declaringClassSignature, Type fieldType) Gets the field signature.@NonNull FieldSubSignaturegetFieldSubSignature(@NonNull String name, @NonNull Type type) Gets the field sub signature.@NonNull PrimitiveTypeGet thefloatprimitive type.@NonNull PrimitiveTypeGet theintprimitive type.@NonNull PrimitiveTypeGet thelongprimitive type.default MethodSubSignatureReturns the main method sub signature@NonNull MethodSignaturegetMethodSignature(@NonNull ClassType declaringClassSignature, @NonNull MethodSubSignature subSignature) Gets the method signature.getMethodSignature(String fullyQualifiedNameDeclClass, String methodName, String fqReturnType, List<String> parameters) Gets the method signature.getMethodSignature(ClassType declaringClassSignature, String methodName, String fqReturnType, List<String> parameters) Gets the method signature.getMethodSignature(ClassType declaringClassSignature, String methodName, Type fqReturnType, List<Type> parameters) Gets the method signature.@NonNull MethodSubSignaturegetMethodSubSignature(@NonNull String name, @NonNull Type returnType, @NonNull Iterable<? extends Type> parameterSignatures) Gets the method sub signature.getPackageName(String packageName) Gets the package name.@NonNull Optional<PrimitiveType>getPrimitiveType(@NonNull String typeName) Gets the primitive type.@NonNull PrimitiveTypeGet theshortprimitive type.getStaticInitializerSignature(ClassType declaringClassSignature) Gets the static initializer method signature.Gets the type.@NonNull Optional<PrimitiveType>getUnboxedType(@NonNull ClassType boxedType) Get the PrimitiveType of a boxed type, if it is defined.booleanisConstructorSignature(@NonNull MethodSignature methodSignature) Checks whether the given method signature is a constructorbooleanisConstructorSubSignature(@NonNull MethodSubSignature methodSubSignature) Checks whether the given method sub signature is a constructorbooleanisMainSubSignature(@NonNull MethodSubSignature methodSubSignature) Checks whether the given method sub signature is the main method signaturebooleanisStaticInitializerSubSignature(@NonNull MethodSubSignature methodSubSignature) Checks whether the given method sub signature is a static initializer@NonNull FieldSignatureparseFieldSignature(@NonNull String fieldSignature) Parses the field signature.@NonNull FieldSubSignatureparseFieldSubSignature(@NonNull String subSignature) Parses the field sub signature.@NonNull MethodSignatureparseMethodSignature(@NonNull String methodSignature) Parses the method signature.@NonNull MethodSubSignatureparseMethodSubSignature(@NonNull String methodSubSignature) Parses the method sub signature.
-
Method Details
-
getPackageName
Gets the package name.- Parameters:
packageName- the package name- Returns:
- the package name
-
getMethodSignature
MethodSignature getMethodSignature(String fullyQualifiedNameDeclClass, String methodName, String fqReturnType, List<String> parameters) Gets the method signature.- Parameters:
fullyQualifiedNameDeclClass- the fully qualified name decl classmethodName- the method namefqReturnType- the fq return typeparameters- the parameters- Returns:
- the method signature
-
getMethodSignature
MethodSignature getMethodSignature(ClassType declaringClassSignature, String methodName, String fqReturnType, List<String> parameters) Gets the method signature.- Parameters:
declaringClassSignature- the declaring class signaturemethodName- the method namefqReturnType- the fq return typeparameters- the parameters- Returns:
- the method signature
-
getMethodSignature
MethodSignature getMethodSignature(ClassType declaringClassSignature, String methodName, Type fqReturnType, List<Type> parameters) Gets the method signature.- Parameters:
declaringClassSignature- the declaring class signaturemethodName- the method namefqReturnType- the fq return typeparameters- the parameters- Returns:
- the method signature
-
getMethodSignature
@NonNull MethodSignature getMethodSignature(@NonNull ClassType declaringClassSignature, @NonNull MethodSubSignature subSignature) Gets the method signature.- Parameters:
declaringClassSignature- the declaring class signaturesubSignature- the sub signature- Returns:
- the method signature
-
parseMethodSignature
Parses the method signature.- Parameters:
methodSignature- the method signature- Returns:
- the method signature
-
getMethodSubSignature
@NonNull MethodSubSignature getMethodSubSignature(@NonNull String name, @NonNull Type returnType, @NonNull Iterable<? extends Type> parameterSignatures) Gets the method sub signature.- Parameters:
name- the nameparameterSignatures- the parameter signaturesreturnType- the return type- Returns:
- the method sub signature
-
parseMethodSubSignature
Parses the method sub signature.- Parameters:
methodSubSignature- the method sub signature- Returns:
- the method sub signature
-
parseFieldSignature
Parses the field signature.- Parameters:
fieldSignature- the field signature- Returns:
- the field signature
-
getFieldSignature
FieldSignature getFieldSignature(String fieldName, ClassType declaringClassSignature, String fieldType) Gets the field signature.- Parameters:
fieldName- the field namedeclaringClassSignature- the declaring class signaturefieldType- the field type- Returns:
- the field signature
-
getFieldSignature
FieldSignature getFieldSignature(String fieldName, ClassType declaringClassSignature, Type fieldType) Gets the field signature.- Parameters:
fieldName- the field namedeclaringClassSignature- the declaring class signaturefieldType- the field type- Returns:
- the field signature
-
getFieldSignature
@NonNull FieldSignature getFieldSignature(@NonNull ClassType declaringClassSignature, @NonNull FieldSubSignature subSignature) Gets the field signature.- Parameters:
declaringClassSignature- the declaring class signaturesubSignature- the sub signature- Returns:
- the field signature
-
getFieldSubSignature
Gets the field sub signature.- Parameters:
name- the nametype- the type- Returns:
- the field sub signature
-
parseFieldSubSignature
Parses the field sub signature.- Parameters:
subSignature- the sub signature- Returns:
- the field sub signature
-
getClassType
Gets the class type.- Parameters:
className- the class namepackageName- the package name- Returns:
- the class type
-
getClassType
Gets the class type.- Parameters:
fullyQualifiedClassName- the fully qualified class name- Returns:
- the class type
-
getType
Gets the type.- Parameters:
typeName- the type name- Returns:
- the type
-
getPrimitiveType
Gets the primitive type.- Parameters:
typeName- the type name- Returns:
- the primitive type
-
getBooleanPrimitiveType
@NonNull PrimitiveType getBooleanPrimitiveType()Get thebooleanprimitive type.- Returns:
- the primitive type instance for
boolean - See Also:
-
getBytePrimitiveType
@NonNull PrimitiveType getBytePrimitiveType()Get thebooleanprimitive type.- Returns:
- the primitive type instance for
boolean - See Also:
-
getShortPrimitiveType
@NonNull PrimitiveType getShortPrimitiveType()Get theshortprimitive type.- Returns:
- the primitive type instance for
short - See Also:
-
getCharPrimitiveType
@NonNull PrimitiveType getCharPrimitiveType()Get thecharprimitive type.- Returns:
- the primitive type instance for
char - See Also:
-
getIntPrimitiveType
@NonNull PrimitiveType getIntPrimitiveType()Get theintprimitive type.- Returns:
- the primitive type instance for
int - See Also:
-
getLongPrimitiveType
@NonNull PrimitiveType getLongPrimitiveType()Get thelongprimitive type.- Returns:
- the primitive type instance for
long - See Also:
-
getFloatPrimitiveType
@NonNull PrimitiveType getFloatPrimitiveType()Get thefloatprimitive type.- Returns:
- the primitive type instance for
float - See Also:
-
getDoublePrimitiveType
@NonNull PrimitiveType getDoublePrimitiveType()Get thedoubleprimitive type.- Returns:
- the primitive type instance for
double - See Also:
-
getBoxedType
Get the ClassType for the boxed primitiveType.- Parameters:
primitiveType-- Returns:
- a ClassType for the boxed type
- See Also:
-
getUnboxedType
Get the PrimitiveType of a boxed type, if it is defined.- Parameters:
boxedType- any type- Returns:
- the PrimitiveType instance corresponding to the boxedType, or empty if such is not defined.
- See Also:
-
getArrayType
Gets the array type.- Parameters:
baseType- the base typedim- the dim- Returns:
- the array type
-
getStaticInitializerSignature
Gets the static initializer method signature.- Parameters:
declaringClassSignature- the declaring class signature- Returns:
- the static initializer method signature
-
isStaticInitializerSubSignature
Checks whether the given method sub signature is a static initializer- Parameters:
methodSubSignature-- Returns:
-
isConstructorSignature
Checks whether the given method signature is a constructor- Parameters:
methodSignature-- Returns:
-
isConstructorSubSignature
Checks whether the given method sub signature is a constructor- Parameters:
methodSubSignature-- Returns:
-
isMainSubSignature
Checks whether the given method sub signature is the main method signature- Parameters:
methodSubSignature-- Returns:
-
getMainSubSignature
Returns the main method sub signature- Returns:
-