org.faktorips.runtime.modeltype
Interface IModelType

All Superinterfaces:
IModelElement
All Known Implementing Classes:
ModelType

public interface IModelType
extends IModelElement

Author:
Daniel Hohenberger

Field Summary
static String PROPERTY_CLASS
           
static String PROPERTY_SUPERTYPE
           
static String XML_TAG
           
 
Fields inherited from interface org.faktorips.runtime.modeltype.IModelElement
DESCRIPTIONS_PROPERTY_LOCALE, DESCRIPTIONS_XML_TAG, DESCRIPTIONS_XML_WRAPPER_TAG, EXTENSION_PROPERTIES_PROPERTY_ID, EXTENSION_PROPERTIES_PROPERTY_NULL, EXTENSION_PROPERTIES_XML_TAG, EXTENSION_PROPERTIES_XML_WRAPPER_TAG, LABELS_PROPERTY_LOCALE, LABELS_PROPERTY_PLURAL_VALUE, LABELS_PROPERTY_VALUE, LABELS_XML_TAG, LABELS_XML_WRAPPER_TAG, PROPERTY_NAME
 
Method Summary
 IModelTypeAssociation getAssociation(String name)
          Returns the association with the given name declared in this type or one of it's super types.
 List<IModelTypeAssociation> getAssociations()
          Returns the type's associations including those defined in it's super types.
 IModelTypeAttribute getAttribute(String name)
          Returns the attribute with the given name declared in this type or one of it's super types.
 List<IModelTypeAttribute> getAttributes()
          Returns a list containing the type's attributes including those defined in the type's super types.
 Object getAttributeValue(IModelObject modelObject, String attributeName)
          Returns the value of the given model object's attribute identified by the given attribute name.
 IModelTypeAssociation getDeclaredAssociation(int index)
          Returns the association at the given index.
 IModelTypeAssociation getDeclaredAssociation(String name)
          Returns the association with the given name declared in this type.
 List<IModelTypeAssociation> getDeclaredAssociations()
          Returns a list containing all associations declared in this model type.
 IModelTypeAttribute getDeclaredAttribute(int index)
          Returns the declared attribute at the given index.
 IModelTypeAttribute getDeclaredAttribute(String name)
          Returns the attribute with the given name declared in this type.
 List<IModelTypeAttribute> getDeclaredAttributes()
          Returns a list containing all attributes declared in this model type.
 Class<?> getJavaClass()
          Returns the Java class for this type.
 Class<?> getJavaInterface()
          Returns the Java interface for this type.
 IModelType getSuperType()
          Returns this model type's super type or null if it has none.
 List<IModelObject> getTargetObjects(IModelObject source, String associationName)
          Returns a list of the target(s) of the given model object's association identified by the given association name.
 void setAttributeValue(IModelObject modelObject, String attributeName, Object value)
          Sets the given model object's attribute identified by the given name to the given value.
 
Methods inherited from interface org.faktorips.runtime.modeltype.IModelElement
getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initExtPropertiesFromXml, initFromXml
 

Field Detail

XML_TAG

static final String XML_TAG
See Also:
Constant Field Values

PROPERTY_CLASS

static final String PROPERTY_CLASS
See Also:
Constant Field Values

PROPERTY_SUPERTYPE

static final String PROPERTY_SUPERTYPE
See Also:
Constant Field Values
Method Detail

getJavaClass

Class<?> getJavaClass()
                      throws ClassNotFoundException
Returns the Java class for this type.

Throws:
ClassNotFoundException - if the class could not be loaded.

getJavaInterface

Class<?> getJavaInterface()
                          throws ClassNotFoundException
Returns the Java interface for this type.

Throws:
ClassNotFoundException - if the class could not be loaded.

getSuperType

IModelType getSuperType()
Returns this model type's super type or null if it has none.


getDeclaredAttributes

List<IModelTypeAttribute> getDeclaredAttributes()
Returns a list containing all attributes declared in this model type. Attributes defined in the type's super types are not returned.


getAttributes

List<IModelTypeAttribute> getAttributes()
Returns a list containing the type's attributes including those defined in the type's super types.


getDeclaredAttribute

IModelTypeAttribute getDeclaredAttribute(int index)
                                         throws IndexOutOfBoundsException
Returns the declared attribute at the given index.

Throws:
IndexOutOfBoundsException - if no attribute exists for the given index.

getDeclaredAttribute

IModelTypeAttribute getDeclaredAttribute(String name)
                                         throws IllegalArgumentException
Returns the attribute with the given name declared in this type. Attributes defined in the type's super types are not returned.

Throws:
IllegalArgumentException - if no attribute with the given name exists.

getAttribute

IModelTypeAttribute getAttribute(String name)
                                 throws IllegalArgumentException
Returns the attribute with the given name declared in this type or one of it's super types.

Throws:
IllegalArgumentException - if no attribute with the given name exists.

getDeclaredAssociations

List<IModelTypeAssociation> getDeclaredAssociations()
Returns a list containing all associations declared in this model type. Associations defined in the type's super types are not returned.


getAssociations

List<IModelTypeAssociation> getAssociations()
Returns the type's associations including those defined in it's super types.


getDeclaredAssociation

IModelTypeAssociation getDeclaredAssociation(int index)
Returns the association at the given index. Associations defined in the type's super types are not returned.

Throws:
IndexOutOfBoundsException - if no association exists for the given index.

getDeclaredAssociation

IModelTypeAssociation getDeclaredAssociation(String name)
Returns the association with the given name declared in this type. Associations defined in the type's super types are not considered.

Throws:
IllegalArgumentException - if no association with the given name exists.

getTargetObjects

List<IModelObject> getTargetObjects(IModelObject source,
                                    String associationName)
Returns a list of the target(s) of the given model object's association identified by the given association name.

Parameters:
source - a model object corresponding to this model type
associationName - the name of the association
Returns:
a list of the target(s) of the given model object's association identified by the given association name
Throws:
IllegalArgumentException - if the model does not fit this model type, has no association by the given name or that association is not accessible for any reason

getAttributeValue

Object getAttributeValue(IModelObject modelObject,
                         String attributeName)
Returns the value of the given model object's attribute identified by the given attribute name.

Parameters:
modelObject - a model object corresponding to this model type
attributeName - the name of the attribute
Returns:
the value of the given model object's attribute identified by the given attribute name
Throws:
IllegalArgumentException - if the model object does not fit this model type, has no attribute by the given name or that attribute is not accessible for any reason
See Also:
IModelTypeAttribute.getValue(IModelObject)

setAttributeValue

void setAttributeValue(IModelObject modelObject,
                       String attributeName,
                       Object value)
Sets the given model object's attribute identified by the given name to the given value. This only works for attributes of type IModelTypeAttribute.AttributeType.CHANGEABLE.

Parameters:
modelObject - a model object corresponding to this model type
value - an object of the datatype for the IModelTypeAttribute by the given name
Throws:
IllegalArgumentException - if the model object does not fit this model type, has no changeable attribute by the given name or that attribute is not accessible for any reason or the value does not fit the attribute's datatype.
See Also:
IModelTypeAttribute.setValue(IModelObject, Object)

getAssociation

IModelTypeAssociation getAssociation(String name)
                                     throws IllegalArgumentException
Returns the association with the given name declared in this type or one of it's super types.

Throws:
IllegalArgumentException - if no association with the given name exists.


Copyright © 2015. All rights reserved.