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. |
<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 IModelTypeIllegalArgumentException - if no association with the given name exists.public abstract List<? extends Attribute> getDeclaredAttributes()
getDeclaredAttributes in interface IModelTypepublic 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 IModelTypeIllegalArgumentException - if no attribute with the given name exists.public abstract Type getSuperType()
null if it has none.getSuperType in interface IModelTypeCopyright © 2018. All rights reserved.