com.sap.tc.cmi.annotations

Interface ICMIClassAnnotationProvider

All Superinterfaces:
ICMIAnnotationProvider
All Known Subinterfaces:
ICMIAnnotatedClass

public interface ICMIClassAnnotationProvider
extends ICMIAnnotationProvider

Specialized annotation provider that associates annotations with attributes and/or relation target roles.

All methods in this interface expect valid arguments. Attribute and role names must be known to the provider. If a component path is given, (not null, not empty), the corresponding attribute must have a Core Data Type and the path must be valid for the concrete CDT. If annotation metadata is available for the provider (see specialized provider ICMIAnnotatedClass), the calls to this interface should be in sync with the metadata. CCTS Support: This interface is designed to work with attributes that have a CCTS Core Data Type. For such attributes, annotations can be provided for the whole attribute and/or for any subcomponent of the attribute. See method getAnnotationValueForAttribute(String, String[], String) for details.

Type Classification Type Classification:

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


Method Summary
 Object getAnnotationValueForAttribute(String attributeName, String annotationName)
          Retrieves the value of the annotation annotationName that is associated with the attribute attributeName.
 Object getAnnotationValueForAttribute(String attributeName, String[] componentPath, String annotationName)
          Retrieves the value of the annotation annotationName that is associated with the component componentPath of the attribute attributeName.
 Object getAnnotationValueForTargetRole(String targetRoleName, String annotationName)
          Retrieves the value of the annotation annotationName that is associated with the relation role target targetRoleName.
 
Methods inherited from interface com.sap.tc.cmi.annotations.ICMIAnnotationProvider
getAnnotationValue
 

Method Detail

getAnnotationValueForAttribute

Object getAnnotationValueForAttribute(String attributeName,
                                      String annotationName)
Retrieves the value of the annotation annotationName that is associated with the attribute attributeName. If the provider in general knows the annotation, but currently has no value associated with the attribute, it should return null. if the annotation in general is not provided by the provider, it should throw a CMINoSuchAnnotationException.

Parameters:
attributeName - String the attribute to get the annotation for
annotationName - the name of the annotation to retrieve
Returns:
the value of the annotation or null if there is no such value.
Throws:
CMINoSuchAnnotationException - if the class generally does not provide the given annotation for the given attribute.

getAnnotationValueForAttribute

Object getAnnotationValueForAttribute(String attributeName,
                                      String[] componentPath,
                                      String annotationName)
Retrieves the value of the annotation annotationName that is associated with the component componentPath of the attribute attributeName. The componentPath may be null or empty in which case the annotation for attribute as a whole is addressed. If the provider in general knows the annotation, but currently has no value associated with the attribute component, this method should return null. If the annotation in general is not provided by the provider, it must throw a CMINoSuchAnnotationException.

Parameters:
attributeName - String the attribute to get the annotation for
componentPath - path to a component of the attribute or null
annotationName - the name of the annotation to retrieve
Returns:
the value of the annotation or null if there is no such value.
Throws:
CMINoSuchAnnotationException - if the class generally does not provide the given annotation for the given attribute component.

getAnnotationValueForTargetRole

Object getAnnotationValueForTargetRole(String targetRoleName,
                                       String annotationName)
Retrieves the value of the annotation annotationName that is associated with the relation role target targetRoleName. If the provider in general knows the annotation, but currently has no value associated with the target role, this method should return null. If the annotation is generally not provided by the provider, the method must throw a CMINoSuchAnnotationException.

Parameters:
targetRoleName - the name of the target role
annotationName - the name of the annotation to retrieve
Returns:
the value of the annotation or null if there is no such value.
Throws:
CMINoSuchAnnotationException - if the anotation in general is unknown to the provider
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] FRAMEWORK [sap.com] tc/cm/ejb/api api BC-JAS-EJB
[sap.com] FRAMEWORK [sap.com] tc/cmi default BC-WD-JAV-RUN


Copyright 2014 SAP AG Complete Copyright Notice