org.faktorips.runtime.modeltype.internal
Class ModelTypeAttribute

java.lang.Object
  extended by org.faktorips.runtime.modeltype.internal.AbstractModelElement
      extended by org.faktorips.runtime.modeltype.internal.ModelTypeAttribute
All Implemented Interfaces:
IModelElement, IModelTypeAttribute

public class ModelTypeAttribute
extends AbstractModelElement
implements IModelTypeAttribute

A ModelTypeAttribute represent an attribute from the PolicyCmptType or the ProductCmptType.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.faktorips.runtime.modeltype.IModelTypeAttribute
IModelTypeAttribute.AttributeType, IModelTypeAttribute.ValueSetType
 
Field Summary
 
Fields inherited from interface org.faktorips.runtime.modeltype.IModelTypeAttribute
PROPERTY_ATTRIBUTE_TYPE, PROPERTY_DATATYPE, PROPERTY_PRODUCT_RELEVANT, PROPERTY_VALUE_SET_TYPE, XML_TAG, 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
 
Constructor Summary
ModelTypeAttribute(ModelType modelType)
           
 
Method Summary
protected  Class<?> findDatatype()
           
 IModelTypeAttribute.AttributeType getAttributeType()
           
 Class<?> getDatatype()
           
 IModelType getModelType()
          Returns the model type this attribute belongs to.
 Object getValue(IModelObject source)
          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
 void initFromXml(XMLStreamReader parser)
          Initializes the model element's state with the data stored in the xml element at the parser's current position.
 boolean isProductRelevant()
          Returns if this attribute is product relevant.
 void setValue(IModelObject source, Object value)
          Sets the given model object's attribute identified by this model type attribute to the given value.
 String toString()
           
 
Methods inherited from class org.faktorips.runtime.modeltype.internal.AbstractModelElement
getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initDescriptionsFromXml, initExtPropertiesFromXml, initLabelFromXml, initLabelsFromXml, setExtensionPropertyValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.faktorips.runtime.modeltype.IModelElement
getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initExtPropertiesFromXml
 

Constructor Detail

ModelTypeAttribute

public ModelTypeAttribute(ModelType modelType)
Method Detail

getModelType

public IModelType getModelType()
Description copied from interface: IModelTypeAttribute
Returns the model type this attribute belongs to.

Specified by:
getModelType in interface IModelTypeAttribute

getDatatype

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

getAttributeType

public IModelTypeAttribute.AttributeType getAttributeType()
Specified by:
getAttributeType in interface IModelTypeAttribute
Returns:
the type of this attribute.

getValueSetType

public IModelTypeAttribute.ValueSetType getValueSetType()
Description copied from interface: IModelTypeAttribute
Returns the type of value set restricting this attribute

Specified by:
getValueSetType in interface IModelTypeAttribute

isProductRelevant

public boolean isProductRelevant()
Description copied from interface: IModelTypeAttribute
Returns if this attribute is product relevant.

Specified by:
isProductRelevant in interface IModelTypeAttribute

initFromXml

public void initFromXml(XMLStreamReader parser)
                 throws XMLStreamException
Description copied from interface: IModelElement
Initializes the model element's state with the data stored in the xml element at the parser's current position.

Specified by:
initFromXml in interface IModelElement
Overrides:
initFromXml in class AbstractModelElement
Throws:
XMLStreamException

findDatatype

protected Class<?> findDatatype()

toString

public String toString()
Overrides:
toString in class Object

getValue

public Object getValue(IModelObject source)
Description copied from interface: IModelTypeAttribute
Returns the value of the given model object's attribute identified by this model type attribute.

Specified by:
getValue in interface IModelTypeAttribute
Parameters:
source - 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

setValue

public void setValue(IModelObject source,
                     Object value)
Description copied from interface: IModelTypeAttribute
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.

Specified by:
setValue in interface IModelTypeAttribute
Parameters:
source - a model object corresponding to the IModelType this attribute belongs to
value - an object of this model type attribute's datatype


Copyright © 2015. All rights reserved.