|
CMI documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Interface for a generic model class.
Model classes that implement this interface are treated specially from the
context. Instead of using reflection to access attributes, it uses
getAttributeValue(String) and setAttributeValue(String, Object).
This type can be called, extended or implemented by applications or frameworks using CMI.
| Method Summary | |
boolean |
addRelatedModelObject(java.lang.String targetRoleName,
ICMIModelClass o)
adds o to the relation role targetRoleName according to the add
method in the java.util.Collection interface. |
ICMIModelClassInfo |
associatedModelClassInfo()
returns the metadata, i.e. |
java.lang.Object |
getAttributeValue(java.lang.String name)
Returns the value of the attribute with the given name as an Object. |
ICMIModelClass |
getRelatedModelObject(java.lang.String targetRoleName)
Returns null or the appropriate object of type ICMIModelClass according
to the relation role in targetRoleName, which must have the cardinality 1 or 0..1. |
java.util.Collection |
getRelatedModelObjects(java.lang.String targetRoleName)
Returns the appropriate collection of objects of type ICMIModelClass according to the relation role in targetRoleName,
which must have the cardinality * or 1..*. |
boolean |
removeRelatedModelObject(java.lang.String targetRoleName,
ICMIModelClass o)
removes o from the relation role targetRoleName according to the
remove method in the java.util.Collection interface. |
void |
setAttributeValue(java.lang.String name,
java.lang.Object value)
Sets the attribute to given value. |
void |
setRelatedModelObject(java.lang.String targetRoleName,
ICMIModelClass o)
Sets the relation role targetRoleName of an x:0..1 or x:1 relation to
object o of type ICMIModelClass. |
void |
setRelatedModelObjects(java.lang.String targetRoleName,
java.util.Collection col)
sets the relation role targetRoleName of an x:* or x:1..* relation to the Collection
col, which contains exclusively objects of type ICMIModelClass. |
| Methods inherited from interface com.sap.tc.cmi.model.ICMIModelClass |
associatedModel |
| Method Detail |
public java.lang.Object getAttributeValue(java.lang.String name)
name as an Object.
It is unspecified, if the attribute is copied, before it is returned, or not.java.lang.IllegalArgumentException - if there is no attribute with the given name
public void setAttributeValue(java.lang.String name,
java.lang.Object value)
value.
It is unspecified, if value is copied, before it is set, or not.java.lang.IllegalArgumentException - if there is no attribute with the given namepublic ICMIModelClass getRelatedModelObject(java.lang.String targetRoleName)
null or the appropriate object of type ICMIModelClass according
to the relation role in targetRoleName, which must have the cardinality 1 or 0..1.
If the role is of cardinality 0..1,
null can be returned.
If there is no relation with an the given target rolename, an
java.lang.IllegalArgumentException is thrown.
public void setRelatedModelObject(java.lang.String targetRoleName,
ICMIModelClass o)
targetRoleName of an x:0..1 or x:1 relation to
object o of type ICMIModelClass.
If o is null and the cardinality of the relation role is 1,
a java.lang.NullPointerException exception is thrown.
If this has no target relation role with the given targetRoleName,
an java.lang.IllegalArgumentException is thrown.
If the model class or the model are read only, or if the model implementation doesn't
support this method, an java.lang.UnsupportedOperationException is thrown.
If the method throws an exception for any of the above reasons, no changes have been
made of course.public java.util.Collection getRelatedModelObjects(java.lang.String targetRoleName)
targetRoleName,
which must have the cardinality * or 1..*.
The collection should be immutable.
If the role is of cardinality 0..*, the collection could be empty, but not
null.
If there is no relation with the given target role name, an
java.lang.IllegalArgumentException is thrown.
If the method throws an exception, no changes are made of course.
public void setRelatedModelObjects(java.lang.String targetRoleName,
java.util.Collection col)
targetRoleName of an x:* or x:1..* relation to the Collection
col, which contains exclusively objects of type ICMIModelClass.
If col is null,
a java.lang.NullPointerException exception is thrown.
If col is empty and the cardinality of the relation role is 1..*,
a java.lang.NullPointerException exception is thrown.
If this has no target relation role with the given targetRoleName,
a java.lang.IllegalArgumentException is thrown.
If the model class or the model are read only, or if the model implementation doesn't
support this method, an java.lang.UnsupportedOperationException is thrown.
If the method throws an exception, no changes are made of course.
public boolean addRelatedModelObject(java.lang.String targetRoleName,
ICMIModelClass o)
o to the relation role targetRoleName according to the add
method in the java.util.Collection interface.
If o is null, a java.lang.NullPointerException exception is thrown
and no changes are made of course.
If this has no target relation role with the given targetRoleName and cardinality
* or 1..*, a java.lang.IllegalArgumentException is thrown.
If the model class or the model are read only, or if the model implementation doesn't
support this method, an java.lang.UnsupportedOperationException is thrown.
If the method throws an exception, no changes are made of course.
public boolean removeRelatedModelObject(java.lang.String targetRoleName,
ICMIModelClass o)
o from the relation role targetRoleName according to the
remove method in the java.util.Collection interface.
If o is null or o was not in the collection,
the method silently returns.
If o is the last element in the relation role, and the cardinality of the role
is 1..*, a java.lang.IllegalArgumentException is thrown.
If this has no target relation role with the given targetRoleName and cardinality
* or 1..*, a java.lang.IllegalArgumentException is thrown.
If the model class or the model are read only, or if the model implementation doesn't
support this method, an java.lang.UnsupportedOperationException is thrown.
If the method throws an exception, no changes are made of course.
public ICMIModelClassInfo associatedModelClassInfo()
null.associatedModelClassInfo in interface ICMIModelClasscom.sap.tc.cmi.model.ICMIModelClass
|
CMI documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||