Package spoon.metamodel
Class Metamodel
java.lang.Object
spoon.metamodel.Metamodel
Represents the Spoon metamodel (incl. at runtime)
-
Field Summary
Modifier and TypeFieldDescriptionqualified names of packages which contain classes (implementations) of spoon modelqualified names of packages which contain interfaces of spoon model -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns all interfaces of the Spoon metamodel.getConcept(Class<? extends CtElement> clazz)
static String
getConceptName(Class<? extends CtElement> conceptClass)
static String
getConceptName(CtType<?> type)
static @Nullable CtClass<?>
getImplementationOfInterface(CtInterface<?> iface)
static Metamodel
static @Nullable CtInterface<?>
getInterfaceOfImplementation(CtClass<?> impl)
static CtRole
getRoleOfMethod(CtMethod<?> method)
-
Field Details
-
MODEL_IFACE_PACKAGES
qualified names of packages which contain interfaces of spoon model -
MODEL_CLASS_PACKAGES
qualified names of packages which contain classes (implementations) of spoon model
-
-
Constructor Details
-
Metamodel
Not in the public API. Parses spoon sources and creates factory with spoon model.- Parameters:
spoonJavaSourcesDirectory
- the root directory of java sources of spoon model. The directory must contain "spoon" directory.
-
Metamodel
- Parameters:
factory
- already loaded factory with all Spoon model types
-
-
Method Details
-
getAllMetamodelInterfaces
Returns all interfaces of the Spoon metamodel. This method is stateless for sake of maintenance. If you need to call it several times, you should store the result. -
getInstance
- Returns:
- Spoon
Metamodel
, which is built once and then returns cached version
-
getConcept
- Parameters:
clazz
- aClass
of Spoon model- Returns:
MetamodelConcept
which describes the `clazz`
-
getConcepts
- Returns:
- all
MetamodelConcept
s of spoon meta model
-
getAllInstantiableMetamodelInterfaces
- Returns:
- List of Spoon model interfaces, which represents instantiable leafs of Spoon metamodel
-
getConceptName
- Parameters:
type
- a spoon model class or interface, whose concept name has to be returned- Returns:
- name of
MetamodelConcept
, which represents Spoon modelCtType
-
getConceptName
-
getImplementationOfInterface
- Parameters:
iface
- the interface of spoon model element- Returns:
CtClass
of Spoon model which implements the spoon model interface. null if there is no implementation.
-
getInterfaceOfImplementation
- Parameters:
impl
- the implementation class of a Spoon element- Returns:
CtInterface
of Spoon model which represents API of the spoon model class. null if there is no implementation.
-
getRoleOfMethod
- Parameters:
method
- to be checked method- Returns:
CtRole
of spoon model method. Looking into all super class/interface implementations of this method
-