com.sap.tc.cmi.model

Interface ICMIWrappableModelClass


public interface ICMIWrappableModelClass

Interface for model classes that are prepared to be wrapped by some technology specific wrapper. Useful if wrapper and wrapped object have to interact with each other or if the wrapped model object can help to construct a wrapper.

Since:
NW Paris

Type Classification Type Classification:

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


Method Summary
 Object wrapAs(Class wrapperClazz)
          Creates a wrapper instance for this model object by using the given wrapper class.
 

Method Detail

wrapAs

Object wrapAs(Class wrapperClazz)
Creates a wrapper instance for this model object by using the given wrapper class. If the class doesn't fit the needs of this model object (e.g. if instances of that class can not be used as wrappers), a ClassCastException is thrown). If a wrapper is returned it is not necessarily a new instance. Already retrieved instances might be reused. However, callers can not rely on such a reuse. So if they need a wrapper for a longer time, they should keep a reference to it and associated it with this model object on their own.

Parameters:
wrapperClazz - Class to create a wrapper instance of.
Returns:
a wrapper object which is of the given class
Throws:
ClassCastException - if given class is not compatible with this model
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