CMI documentation

com.sap.tc.cmi.metadata
Interface ICMIModelClassInfo

All Superinterfaces:
ICMIAbstractInfo

public interface ICMIModelClassInfo
extends ICMIAbstractInfo

Represents the metadata of a model class at runtime. This type can be called, extendeded or implemented by applications or frameworks using CMI.

Version:
$Id: //tc/CommonModelInterface/630_VAL_REL/src/_cmi_api/java/com/sap/tc/cmi/metadata/ICMIModelClassInfo.java#1 $

Method Summary
 ICMIModelInfo getModelInfo()
          Returns the metadata of the model to which the class belongs.
 java.lang.String getName()
          returns the name of the model class.
 ICMIModelClassPropertyInfo getPropertyInfo(java.lang.String name)
          returns the property metadata of the model class for the property with the given name.
 java.util.Collection getPropertyInfos()
          Returns a collection of all properties of the class.
 ICMIModelClassInfo getRelatedModelClassInfo(java.lang.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.
 java.util.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(java.lang.String targetRoleName)
          Returns the metadata for the target role with the given name.
 boolean isGeneric()
          Returns true, if the class by this meta info implements ICMIGenericModelClass and thereby provides generic access to properties and relation roles.
 java.util.Iterator iteratePropertyInfos()
          returns an iterator over all properties of the classes.
 java.util.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

public java.lang.String getName()
returns the name of the model class. There possible, this should be the full qualified class name of the model class. However, at least for generic model implementations this makes not always sense.
Specified by:
getName in interface ICMIAbstractInfo

getModelInfo

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

getPropertyInfos

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

iteratePropertyInfos

public java.util.Iterator iteratePropertyInfos()
returns an iterator over all properties of the classes. The iterator should be immutable.

getPropertyInfo

public ICMIModelClassPropertyInfo getPropertyInfo(java.lang.String name)
returns the property metadata of the model class for the property with the given name.

getStructureType

public 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.

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


getSourceRoleInfos

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

iterateSourceRoleInfos

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

getTargetRoleInfo

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

getRelatedModelClassInfo

public ICMIModelClassInfo getRelatedModelClassInfo(java.lang.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

public boolean isGeneric()
Returns true, if the class by this meta info implements ICMIGenericModelClass and thereby provides generic access to properties and relation roles.
See Also:
ICMIGenericModelClass

CMI documentation

Copyright © 2002 SAP AG. Automatically generated Thu Mar 3 2005, 21:53