public class ModelType extends AbstractModelElement implements IModelType
PROPERTY_CLASS, PROPERTY_SUPERTYPE, XML_TAGDESCRIPTIONS_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 and Description |
|---|
ModelType(IRuntimeRepository repository) |
| Modifier and Type | Method and Description |
|---|---|
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 source,
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 |
initFromXml(XMLStreamReader parser)
Initializes the model element's state with the data stored in the xml element at the parser's
current position.
|
void |
setAttributeValue(IModelObject source,
String attributeName,
Object value)
Sets the given model object's attribute identified by the given name to the given value.
|
String |
toString() |
getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initDescriptionsFromXml, initExtPropertiesFromXml, initLabelFromXml, initLabelsFromXml, setExtensionPropertyValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initExtPropertiesFromXmlpublic ModelType(IRuntimeRepository repository)
public IModelTypeAssociation getDeclaredAssociation(int index)
IModelTypeindex. Associations defined in the type's
super types are not returned.getDeclaredAssociation in interface IModelTypepublic IModelTypeAssociation getDeclaredAssociation(String name)
IModelTypename declared in this type. Associations
defined in the type's super types are not considered.getDeclaredAssociation in interface IModelTypepublic List<IModelTypeAssociation> getDeclaredAssociations()
IModelTypegetDeclaredAssociations in interface IModelTypepublic List<IModelTypeAssociation> getAssociations()
IModelTypegetAssociations in interface IModelTypepublic IModelTypeAssociation getAssociation(String name) throws IllegalArgumentException
IModelTypename declared in this type or one of it's
super types.getAssociation in interface IModelTypeIllegalArgumentException - if no association with the given name exists.public List<IModelObject> getTargetObjects(IModelObject source, String associationName)
IModelTypegetTargetObjects in interface IModelTypesource - a model object corresponding to this model typeassociationName - the name of the associationpublic IModelTypeAttribute getDeclaredAttribute(int index) throws IndexOutOfBoundsException
IModelTypeindex.getDeclaredAttribute in interface IModelTypeIndexOutOfBoundsException - if no attribute exists for the given index.public IModelTypeAttribute getDeclaredAttribute(String name) throws IllegalArgumentException
IModelTypename 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 IModelTypeAttribute getAttribute(String name) throws IllegalArgumentException
IModelTypename declared in this type or one of it's
super types.getAttribute in interface IModelTypeIllegalArgumentException - if no attribute with the given name exists.public List<IModelTypeAttribute> getDeclaredAttributes()
IModelTypegetDeclaredAttributes in interface IModelTypepublic List<IModelTypeAttribute> getAttributes()
IModelTypegetAttributes in interface IModelTypepublic Object getAttributeValue(IModelObject source, String attributeName)
IModelTypegetAttributeValue in interface IModelTypesource - a model object corresponding to this model typeattributeName - the name of the attributeIModelTypeAttribute.getValue(IModelObject)public void setAttributeValue(IModelObject source, String attributeName, Object value)
IModelTypeIModelTypeAttribute.AttributeType.CHANGEABLE.setAttributeValue in interface IModelTypesource - a model object corresponding to this model typevalue - an object of the datatype for the IModelTypeAttribute by the given nameIModelTypeAttribute.setValue(IModelObject, Object)public Class<?> getJavaClass() throws ClassNotFoundException
IModelTypegetJavaClass in interface IModelTypeClassNotFoundException - if the class could not be loaded.public Class<?> getJavaInterface() throws ClassNotFoundException
IModelTypegetJavaInterface in interface IModelTypeClassNotFoundException - if the class could not be loaded.public IModelType getSuperType()
IModelTypenull if it has none.getSuperType in interface IModelTypepublic void initFromXml(XMLStreamReader parser) throws XMLStreamException
IModelElementinitFromXml in interface IModelElementinitFromXml in class AbstractModelElementXMLStreamExceptionCopyright © 2014. All rights reserved.