org.faktorips.runtime.modeltype
Interface IModelTypeAttribute

All Superinterfaces:
IModelElement
All Known Implementing Classes:
ModelTypeAttribute

public interface IModelTypeAttribute
extends IModelElement

Author:
Daniel Hohenberger

Nested Class Summary
static class IModelTypeAttribute.AttributeType
          Enum defining the possible attribute types.
static class IModelTypeAttribute.ValueSetType
          Enum defining the possible value set types.
 
Field Summary
static String PROPERTY_ATTRIBUTE_TYPE
           
static String PROPERTY_DATATYPE
           
static String PROPERTY_PRODUCT_RELEVANT
           
static String PROPERTY_VALUE_SET_TYPE
           
static String XML_TAG
           
static String XML_WRAPPER_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
 IModelTypeAttribute.AttributeType getAttributeType()
           
 Class<?> getDatatype()
           
 IModelType getModelType()
          Returns the model type this attribute belongs to.
 Object getValue(IModelObject modelObject)
          Returns the value of the given model object's attribute identified by this model type attribute.
 IModelTypeAttribute.ValueSetType getValueSetType()
          Returns the type of value set restricting this attribute
 boolean isProductRelevant()
          Returns if this attribute is product relevant.
 void setValue(IModelObject modelObject, Object value)
          Sets the given model object's attribute identified by this model type attribute 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

XML_WRAPPER_TAG

static final String XML_WRAPPER_TAG
See Also:
Constant Field Values

PROPERTY_DATATYPE

static final String PROPERTY_DATATYPE
See Also:
Constant Field Values

PROPERTY_VALUE_SET_TYPE

static final String PROPERTY_VALUE_SET_TYPE
See Also:
Constant Field Values

PROPERTY_ATTRIBUTE_TYPE

static final String PROPERTY_ATTRIBUTE_TYPE
See Also:
Constant Field Values

PROPERTY_PRODUCT_RELEVANT

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

getModelType

IModelType getModelType()
Returns the model type this attribute belongs to.


getDatatype

Class<?> getDatatype()
                     throws ClassNotFoundException
Returns:
this attribute's datatype Class.
Throws:
ClassNotFoundException - if the datatype's class can not be loaded.

getAttributeType

IModelTypeAttribute.AttributeType getAttributeType()
Returns:
the type of this attribute.

getValueSetType

IModelTypeAttribute.ValueSetType getValueSetType()
Returns the type of value set restricting this attribute


isProductRelevant

boolean isProductRelevant()
Returns if this attribute is product relevant.


getValue

Object getValue(IModelObject modelObject)
Returns the value of the given model object's attribute identified by this model type attribute.

Parameters:
modelObject - a model object corresponding to the IModelType this attribute belongs to
Returns:
the value of the given model object's attribute identified by this model type attribute
Throws:
IllegalArgumentException - if the model object does not have an attribute fitting this model type attribute or that attribute is not accessible for any reason

setValue

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

Parameters:
modelObject - a model object corresponding to the IModelType this attribute belongs to
value - an object of this model type attribute's datatype
Throws:
IllegalArgumentException - if the model object does not have a changeable attribute fitting this model type attribute or that attribute is not accessible for any reason or the value does not fit the attribute's datatype.


Copyright © 2015. All rights reserved.