Class AnnotatedDeclaration
java.lang.Object
org.faktorips.runtime.model.annotation.AnnotatedDeclaration
Helper class that represents a type that was generated by Faktor-IPS with meta data in its
annotations. The meta data for a type is split into interface and implementation, sometimes only
the implementation class exists. AnnotatedDeclaration allows reading the meta data annotations
regardless of which class was annotated in the end.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic AnnotatedDeclarationCreates a newAnnotatedDeclarationfrom the given class.<T extends Annotation>
TReturns the specified annotation if present.Returns theClassLoaderfrom the this annotated type.Returns all fields that are declared in this type.Returns all methods that are declared in this type.Class<?>Returns the implementation class of this type.Class<?>Returns the published interface of this type.inthashCode()booleanis(Class<? extends Annotation> annotationClass) Returnstrueif this represented type is annotated with the specified annotation class.
-
Method Details
-
from
Creates a newAnnotatedDeclarationfrom the given class. The given class is either an implementation or a published interface.- Parameters:
generatedClass- The class that was generated for the model type- Returns:
- An instance of
AnnotatedDeclarationfor the given generated class
-
is
Returnstrueif this represented type is annotated with the specified annotation class.- Parameters:
annotationClass- The annotation class that should be present- Returns:
trueif the annotation is present elsefalse
-
get
Returns the specified annotation if present. Returnsnullif it is not present. Use #is(Class) to check whether the annotation is present or not- Parameters:
annotationClass- The class of the requested annotation- Returns:
- The requested annotation if present else null
-
getDeclaredFields
Returns all fields that are declared in this type. That means it collects all fields from the implementation and published interface. If this type represents a product component type it also adds all fields from generations.- Returns:
- A list of fields that are declared in this type
-
getDeclaredMethods
Returns all methods that are declared in this type. That means it collects all methods from the implementation and published interface. If this type represents a product component type it also adds all methods from generations.- Returns:
- A list of fields that are declared in this type
-
getDeclaredElements
-
getClassLoader
Returns theClassLoaderfrom the this annotated type. ThisClassLoadercould be used to load further resources like corresponding property files. -
getImplementationClass
Returns the implementation class of this type. -
getPublishedInterface
Returns the published interface of this type. -
getDeclarationClassName
-
hashCode
public int hashCode() -
equals
-