public abstract class Type extends ModelElement implements IModelType
Type represents a design time type of Faktor-IPS. It provides all meta data for the
type as well as for properties like attributes or associations.| Modifier and Type | Class and Description |
|---|---|
static class |
Type.AnnotatedElementMatcher<T extends Annotation>
Matcher for methods or fields based on annotation properties.
|
| Constructor and Description |
|---|
Type(String name,
AnnotatedDeclaration annotatedDeclaration) |
| Modifier and Type | Method and Description |
|---|---|
protected AnnotatedDeclaration |
getAnnotatedDeclaration()
Returns the
AnnotatedDeclaration object for this model type that should be used to
read all annotations. |
Association |
getAssociation(String name)
Returns the association with the given
name declared in this type or one of it's
super types. |
abstract List<? extends Association> |
getAssociations()
Returns the type's associations including those defined in it's super types.
|
Attribute |
getAttribute(String name)
Returns the attribute with the given
name declared in this type or one of it's
super types. |
abstract List<? extends Attribute> |
getAttributes()
Returns a list containing the type's attributes including those defined in the type's super
types.
|
Class<?> |
getDeclarationClass() |
Association |
getDeclaredAssociation(int index)
Returns the association at the given
index. |
abstract Association |
getDeclaredAssociation(String name)
Returns the association with the given
name declared in this type. |
abstract List<? extends Association> |
getDeclaredAssociations()
Returns a list containing all associations declared in this type.
|
Attribute |
getDeclaredAttribute(int index)
Returns the declared attribute at the given
index. |
abstract Attribute |
getDeclaredAttribute(String name)
Returns the attribute with the given
name declared in this type. |
abstract List<? extends Attribute> |
getDeclaredAttributes()
Returns a list containing all attributes declared in this model type.
|
protected List<Method> |
getDeclaredMethods() |
Class<?> |
getJavaClass()
Returns the Java class for this type.
|
Class<?> |
getJavaInterface()
Returns the published interface for this type.
|
protected abstract String |
getKindName() |
protected MessagesHelper |
getMessageHelper() |
protected String |
getMessageKey(DocumentationKind messageType) |
abstract Type |
getSuperType()
Returns this type's super type or
null if it has none. |
abstract boolean |
isAssociationDeclared(String name)
Returns whether the association with the given
name is declared in this type. |
boolean |
isAssociationPresent(String name)
Returns whether the association with the given
name is declared in this type or
in any supertype. |
abstract boolean |
isAttributeDeclared(String name)
Returns whether the attribute with the given
name is declared in this type. |
boolean |
isAttributePresent(String name)
Returns whether the attribute with the given
name is declared in this type or in
any supertype. |
boolean |
isSuperTypePresent()
Returns whether this type has a super type.
|
<T extends Annotation> |
searchDeclaredMethod(Class<T> annotationClass,
Type.AnnotatedElementMatcher<T> matcher)
Searches for a method with the given annotation that matches the condition defined by a
matcher. |
String |
toString() |
createMessageHelper, getDescription, getDocumentation, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRelevantProductObject, invokeField, invokeMethodclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getNamepublic Type(String name, AnnotatedDeclaration annotatedDeclaration)
protected abstract String getKindName()
protected String getMessageKey(DocumentationKind messageType)
getMessageKey in class ModelElementprotected MessagesHelper getMessageHelper()
getMessageHelper in class ModelElementpublic Association getDeclaredAssociation(int index)
index. Associations defined in the type's
super types are not returned.getDeclaredAssociation in interface IModelTypeIndexOutOfBoundsException - if no association exists for the given index.public Attribute getDeclaredAttribute(int index)
index.getDeclaredAttribute in interface IModelTypeIndexOutOfBoundsException - if no attribute exists for the given index.public Association getAssociation(String name)
name declared in this type or one of it's
super types. The name could either be the singular or the plural name.getAssociation in interface IModelTypeIllegalArgumentException - if no association with the given name exists.public Attribute getAttribute(String name)
name declared in this type or one of it's
super types.getAttribute in interface IModelTypeIllegalArgumentException - if no attribute with the given name exists.protected AnnotatedDeclaration getAnnotatedDeclaration()
AnnotatedDeclaration object for this model type that should be used to
read all annotations.public Class<?> getJavaClass()
getJavaClass in interface IModelTypepublic Class<?> getJavaInterface()
null if published
interfaces are not generated.getJavaInterface in interface IModelTypepublic Class<?> getDeclarationClass()
public String toString()
toString in class ModelElementpublic <T extends Annotation> Method searchDeclaredMethod(Class<T> annotationClass, Type.AnnotatedElementMatcher<T> matcher)
matcher. Only methods in this type's declaration class are
considered, thus no methods from super classes are found.annotationClass - the class of the annotation the method must be annotated withmatcher - matcher to determine if the annotation has the correct propertiesnull if no such method can be found.public abstract List<? extends Association> getDeclaredAssociations()
getDeclaredAssociations in interface IModelTypepublic abstract List<? extends Association> getAssociations()
getAssociations in interface IModelTypepublic abstract Association getDeclaredAssociation(String name)
name declared in this type. Associations
defined in the type's super types are not considered. The name could either be the singular
or the plural name.getDeclaredAssociation in interface IModelTypename - the name of the associationIllegalArgumentException - if no association with the given name existsisAssociationDeclared(String)public abstract boolean isAssociationDeclared(String name)
name is declared in this type.
Associations defined in the type's super types are not considered.name - the name of the associationtrue if the association is declared in this type, false if
notisAssociationPresent(String)public boolean isAssociationPresent(String name)
name is declared in this type or
in any supertype.name - the name of the associationtrue if the association is declared in this type or in any supertype,
false if notisAssociationDeclared(String)public abstract List<? extends Attribute> getDeclaredAttributes()
getDeclaredAttributes in interface IModelTypepublic abstract boolean isAttributeDeclared(String name)
name is declared in this type.
Attributes defined in the type's super types are not considered.name - the name of the attributetrue if the attribute is declared in this type, false if
notpublic boolean isAttributePresent(String name)
name is declared in this type or in
any supertype.name - the name of the attributetrue if the attribute is declared in this type or in any supertype,
false if notpublic abstract List<? extends Attribute> getAttributes()
getAttributes in interface IModelTypepublic abstract Attribute getDeclaredAttribute(String name)
name declared in this type. Attributes
defined in the type's super types are not returned.getDeclaredAttribute in interface IModelTypename - the name of the attributeIllegalArgumentException - if no attribute with the given name existsisAttributeDeclared(String)public boolean isSuperTypePresent()
true if this type has a supertype, false if notpublic abstract Type getSuperType()
null if it has none.getSuperType in interface IModelTypeCopyright © 2021. All rights reserved.