com.sap.tc.cmi.metadata

Interface ICMIModelClassInfo

All Superinterfaces:
ICMIAbstractInfo
All Known Subinterfaces:
ICMIAnnotatedClassInfo

public interface ICMIModelClassInfo
extends ICMIAbstractInfo

Represents the metadata of a model class at runtime.

This type can be called, extended or implemented by applications or frameworks using CMI.

Compatibility of ModelClasses
A model object o (instance of a model class) is compatible with an ICMIModelClassInfo info if the following conditions are met:

   if ( o is a typed model )
     each property described by info is available in o
     each navigable relation role described by info is available in o
 
   if ( o instanceof ICMIGenericModelClass )
     each property info in info is accepted by o
     each navigable relation role info in info is accepted by o
 
   if ( o instanceof ICMIModelClass and o.associatedModelClassInfo() != null )
     each property described by info has an equivalent property in o.associatedModelClassInfo()
     each relation role described by info has an equivalent role in o.associatedModelClassInfo()
 
 
The concept behind the rules above is that runtime metadata must allow implements and extends relationships on the corresponding model classes. All properties/roles described by an interface or a base class must be available and accepted in/by the implementations/subclasses as well.

Type Classification Type Classification:

This interface is part of the Common Model Interface and is intended to be implemented by applications.


Method Summary
 ICMIModelInfo getModelInfo()
          Returns the metadata of the model to which the class belongs.
 String getName()
          Returns the name of the model class.
 ICMIModelClassPropertyInfo getPropertyInfo(String name)
          Returns the property metadata of the model class for the property with the given name.
 Collection getPropertyInfos()
          Returns a collection of all properties of the class.
 ICMIModelClassInfo getRelatedModelClassInfo(String targetRoleName)
          Convenience method which returns the metadata for the model class to which this model class is related via a relation, where the relation is determined through the named target role of this model class.
 Collection getSourceRoleInfos()
          Returns a collection of all source roles of the class.
 com.sap.dictionary.runtime.IStructure getStructureType()
          Returns the Java DDIC IStructure of the model class info.
 ICMIRelationRoleInfo getTargetRoleInfo(String targetRoleName)
          Returns the metadata for the target role with the given name.
 boolean isGeneric()
          Returns true, if the class that is described by this meta data, implements ICMIGenericModelClass and thereby provides generic access to properties and relation roles.
 Iterator iteratePropertyInfos()
          Returns an iterator over all properties of the classes.
 Iterator iterateSourceRoleInfos()
          Returns an iterator over all source roles of the class.
 
Methods inherited from interface com.sap.tc.cmi.metadata.ICMIAbstractInfo
addSupportedOption, getSetting, getSettings, setSetting, supportedOptions, supports
 

Method Detail

getName

String getName()
Returns the name of the model class. Where possible, this should be the full qualified class name of the model class. However, at least for generic model implementations this does not always make sense.

Specified by:
getName in interface ICMIAbstractInfo

getModelInfo

ICMIModelInfo getModelInfo()
Returns the metadata of the model to which the class belongs.


getPropertyInfos

Collection getPropertyInfos()
Returns a collection of all properties of the class. The collection should be immutable.


iteratePropertyInfos

Iterator iteratePropertyInfos()
Returns an iterator over all properties of the classes. The iterator should be immutable.


getPropertyInfo

ICMIModelClassPropertyInfo getPropertyInfo(String name)
Returns the property metadata of the model class for the property with the given name.


getStructureType

com.sap.dictionary.runtime.IStructure getStructureType()
Returns the Java DDIC IStructure of the model class info.

A ICMIModelClassInfo can have an Java DDIC IStructure associated. In this case, for all IField instances in the associated IStructure instance, there can be a corresponding ICMIModelClassPropertyInfo instance, that belongs to the ICMIModelClassInfo, with

   field.getDatatype().equals(propertyInfo.getDataType())
 

For the time being all IField instances of an IStructure must have a corresponding ICMIModelClassPropertyInfo instance in the ICMIModelClassInfo. However in the future an ICMIModelClassInfo may contain only some of the fields of the structure. Therefore today's clients must be programmed already in a way that they work properly, even if some of the IField instances have no corresponding ICMIModelClassPropertyInfo instance.

An ICMIModelClassInfo instance that has an association to an IStructure may contain also ICMIModelClassPropertyInfo instances that have no corresponding IField instances in the associated IStructure.

If an ICMIModelClassInfo is not associated to an IStructure, the method returns null.

A Model implementation does not have to support this association. Then null will be returned in all cases.


getSourceRoleInfos

Collection getSourceRoleInfos()
Returns a collection of all source roles of the class. The collection should be immutable.


iterateSourceRoleInfos

Iterator iterateSourceRoleInfos()
Returns an iterator over all source roles of the class. The iterator should be immutable.


getTargetRoleInfo

ICMIRelationRoleInfo getTargetRoleInfo(String targetRoleName)
Returns the metadata for the target role with the given name. If there is no such role, null will be returned.


getRelatedModelClassInfo

ICMIModelClassInfo getRelatedModelClassInfo(String targetRoleName)
Convenience method which returns the metadata for the model class to which this model class is related via a relation, where the relation is determined through the named target role of this model class. If there is no such relation, null will be returned.

Note, that the semantic of the String parameter changed from sourceRoleName to targetRoleName on 2003-04-16. Implementations must adapt to this change. The behavior of this method is equivalent to

 if (getTargetRoleInfo(targetRoleName) != null)
      return getTargetRoleInfo(targetRoleName).getModelClassInfo();
 return null;  
 


isGeneric

boolean isGeneric()
Returns true, if the class that is described by this meta data, implements ICMIGenericModelClass and thereby provides generic access to properties and relation roles.

Access Rights

This class can be accessed from:


SC DC
[sap.com] FRAMEWORK [sap.com] tc/cmi
[sap.com] FRAMEWORK [sap.com] tc/cm/ejb/api


Copyright 2010 SAP AG Complete Copyright Notice