Package spoon.reflect.factory
Class ClassFactory
java.lang.Object
spoon.reflect.factory.SubFactory
spoon.reflect.factory.TypeFactory
spoon.reflect.factory.ClassFactory
The
CtClass
sub-factory.-
Field Summary
Fields inherited from class spoon.reflect.factory.TypeFactory
BOOLEAN, BOOLEAN_PRIMITIVE, BYTE, BYTE_PRIMITIVE, CHARACTER, CHARACTER_PRIMITIVE, COLLECTION, DATE, DOUBLE, DOUBLE_PRIMITIVE, ENUM, FLOAT, FLOAT_PRIMITIVE, INTEGER, INTEGER_PRIMITIVE, ITERABLE, LIST, LONG, LONG_PRIMITIVE, MAP, NULL_TYPE, OBJECT, OMITTED_TYPE_ARG_TYPE, SET, SHORT, SHORT_PRIMITIVE, STRING, VOID, VOID_PRIMITIVE
Fields inherited from class spoon.reflect.factory.SubFactory
factory
-
Constructor Summary
-
Method Summary
Methods inherited from class spoon.reflect.factory.TypeFactory
booleanPrimitiveType, booleanType, bytePrimitiveType, byteType, characterPrimitiveType, characterType, createArrayReference, createArrayReference, createArrayReference, createArrayReference, createImport, createIntersectionTypeReferenceWithBounds, createReference, createReference, createReference, createReference, createReference, createReference, createReferences, createSimplyQualifiedReference, createTypeAdapter, createTypeMemberWildcardImportReference, createTypeParameterReference, createUnresolvedImport, dateType, doublePrimitiveType, doubleType, floatPrimitiveType, floatType, getAll, getAll, getDeclaringTypeName, getDefaultBoundingType, getPackageName, getSimpleName, hasInnerType, hasPackage, integerPrimitiveType, integerType, longPrimitiveType, longType, nullType, objectType, shortPrimitiveType, shortType, stringType, voidPrimitiveType, voidType
-
Constructor Details
-
ClassFactory
Creates a class sub-factory.- Parameters:
factory
- the parent factory
-
-
Method Details
-
create
Creates an inner class.- Parameters:
declaringClass
- declaring classsimpleName
- simple name of inner class (without . or $)
-
create
Creates a top-level class.- Parameters:
owner
- the declaring packagesimpleName
- the simple name
-
create
Creates a class from its qualified name.- Type Parameters:
T
- type of created class- Parameters:
qualifiedName
- full name of class to create. Name can contain $ for inner types
-
get
Gets a class from its runtime Java class.- Overrides:
get
in classTypeFactory
- Type Parameters:
T
- type of created class- Parameters:
cl
- the java class: note that this class should be Class<T> but it then poses problem when T is a generic type itself
-
get
Searches for a class from his qualified name.- Overrides:
get
in classTypeFactory
- Type Parameters:
T
- the type of the class- Parameters:
qualifiedName
- to search- Returns:
- found class or null
-