com.sap.tc.mobile.cfs.meta.api
Interface ClassDescriptor

All Superinterfaces:
AbstractDescriptor, StorageTypeDescriptor

public interface ClassDescriptor
extends StorageTypeDescriptor

ClassDescriptor describes one class, together with its attributes.

Author:
d039184
See Also:
AttributeDescriptor

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sap.tc.mobile.cfs.meta.api.AbstractDescriptor
AbstractDescriptor.Visitor
 
Method Summary
 boolean canCreate()
          Check for creation allowed.
 boolean canDelete()
          Check for delete allowed.
 boolean canUpdate()
          Check for update allowed.
 java.lang.String getAliasName()
          Get alias class name (used in model and queries).
 AttributeDescriptor getAttribute(int id)
          Get attribute descriptor by id.
 AttributeDescriptor getAttribute(java.lang.String name)
          Get attribute descriptor for given model attribute name.
 int getAttributeCount()
          Get total attribute count (including those of superclasses).
 int getAttributeIndex(AttributeDescriptor attribute)
          Get index of the attribute within this class.
 AttributeDescriptor[] getAttributes()
          Get all attribute descriptors in this class, including those of superclasses.
 AttributeDescriptor getAttributeTechnical(java.lang.String name)
          Get attribute descriptor for given technical attribute name.
 AuthorizationDescriptor getAuthorization(java.lang.String aoName)
          Get authorization descriptor for given AO.
 AuthorizationDescriptor[] getAuthorizations()
          Get authorization descriptors for this class.
 boolean getMBOInstanceFlag()
          Check upload flag (client to server).
 java.lang.Class getObjectClass()
          Get object class this descriptor represents.
 java.lang.String getOwningMBO()
          Get name of MBO owning this class.
 ModelDescriptor getOwningModel()
          Get the model owning this class.
 AttributeDescriptor getPSyncKeyAttribute()
          Get PSYNCKEY attribute of the MBO node (if it's an MBO child node).
 RelationDescriptor[] getRelations()
          Get relations going from this class (where it is source).
 ClassDescriptor getSuperclass()
          Get superclass of this class.
 java.lang.String getSyncBOSuffix()
          get SyncBO Suffix
 AttributeDescriptor getSyncKeyAttribute()
          Get SYNCKEY attribute of the MBO node (if it's an MBO node).
 java.lang.String getTechnicalName()
          Get technical class name (used in persistency and sync).
 GUID getTypeGUID()
          Get GUID of the MBO type represented by this root class (specific to mobile middleware).
 boolean hasAggregations()
          Check for aggregations from this class.
 boolean hasReferences()
          Check for object references from this class.
 boolean isDownload()
          Check download flag (server to client).
 boolean isInstanceOf(ClassDescriptor cdesc)
          Check for instance of given class.
 boolean isKeepInstance()
          Check keep instance flag for upload-only MBOs.
 boolean isRoot()
          Check whether this class is a root class.
 boolean isUpload()
          Check upload flag (client to server).
 
Methods inherited from interface com.sap.tc.mobile.cfs.meta.api.StorageTypeDescriptor
getStorageType
 
Methods inherited from interface com.sap.tc.mobile.cfs.meta.api.AbstractDescriptor
addUserDescriptor, clearAllUserDescriptors, getUserDescriptor, removeUserDescriptor, visit
 

Method Detail

getOwningModel

ModelDescriptor getOwningModel()
Get the model owning this class.

Returns:
owning model.

getSuperclass

ClassDescriptor getSuperclass()
Get superclass of this class.

Returns:
superclass descriptor or null, if none.

getTypeGUID

GUID getTypeGUID()
Get GUID of the MBO type represented by this root class (specific to mobile middleware).

Returns:
type GUID (specific to mobile middleware).

getOwningMBO

java.lang.String getOwningMBO()
Get name of MBO owning this class.

Returns:
MBO name or null if not assigned.

getSyncKeyAttribute

AttributeDescriptor getSyncKeyAttribute()
Get SYNCKEY attribute of the MBO node (if it's an MBO node).

Returns:
sync key attribute or null if not found.

getPSyncKeyAttribute

AttributeDescriptor getPSyncKeyAttribute()
Get PSYNCKEY attribute of the MBO node (if it's an MBO child node).

Returns:
parent sync key attribute or null if not found.

getTechnicalName

java.lang.String getTechnicalName()
Get technical class name (used in persistency and sync).

Returns:
technical class name.

getAliasName

java.lang.String getAliasName()
Get alias class name (used in model and queries).

Returns:
alias class name.

getObjectClass

java.lang.Class getObjectClass()
                               throws java.lang.IllegalStateException
Get object class this descriptor represents.

Returns:
object class or null for unknown (manually-constructed).
Throws:
java.lang.IllegalStateException - if Java class for this class cannot be found.

isRoot

boolean isRoot()
Check whether this class is a root class.

Returns:
true, if this is a root class.

getMBOInstanceFlag

boolean getMBOInstanceFlag()
Check upload flag (client to server).

Returns:
true, iff MBO instance flag is true.

isUpload

boolean isUpload()
Check upload flag (client to server).

Returns:
true, iff instances of this class are uploaded.

isDownload

boolean isDownload()
Check download flag (server to client).

Returns:
true, iff instances of this class are downloaded.

isKeepInstance

boolean isKeepInstance()
Check keep instance flag for upload-only MBOs.

Returns:
true, if the instance won't be deleted automatically on confirm, but by application.

hasAggregations

boolean hasAggregations()
Check for aggregations from this class. Note: implemented only at runtime.

Returns:
true, iff there are any aggregations, where this class is parent.

hasReferences

boolean hasReferences()
Check for object references from this class. Note: implemented only at runtime.

Returns:
true, iff there are any persistent references to other object to other classes.

canCreate

boolean canCreate()
Check for creation allowed.

Returns:
true, if this class can be created on client.

canUpdate

boolean canUpdate()
Check for update allowed.

Returns:
true, if this class can be changed on client.

canDelete

boolean canDelete()
Check for delete allowed.

Returns:
true, if this class can be deleted on client.

getAttributeTechnical

AttributeDescriptor getAttributeTechnical(java.lang.String name)
Get attribute descriptor for given technical attribute name.

Parameters:
name - attribute name (technical name).
Returns:
attribute descriptor or null, if the attribute has not been found.

getAttribute

AttributeDescriptor getAttribute(java.lang.String name)
Get attribute descriptor for given model attribute name.

Parameters:
name - attribute name (descriptive model name).
Returns:
attribute descriptor or null, if the attribute has not been found.

getAttribute

AttributeDescriptor getAttribute(int id)
                                 throws java.lang.ArrayIndexOutOfBoundsException
Get attribute descriptor by id.

Parameters:
id - attribute ID.
Returns:
attribute descriptor.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the ID doesn't identify an attribute.

getAttributes

AttributeDescriptor[] getAttributes()
Get all attribute descriptors in this class, including those of superclasses. This method allocates the array dynamically, to prevent the user to destroy internal structures.

Returns:
all attribute descriptors in this class.

getAttributeCount

int getAttributeCount()
Get total attribute count (including those of superclasses).

Returns:
total attribute count.

getAttributeIndex

int getAttributeIndex(AttributeDescriptor attribute)
                      throws java.lang.IllegalArgumentException
Get index of the attribute within this class.

Parameters:
attribute - attribute to get index of.
Returns:
index of the attribute within the class (0-based).
Throws:
java.lang.IllegalArgumentException - if the attribute is not in the class.

getRelations

RelationDescriptor[] getRelations()
Get relations going from this class (where it is source).

Returns:
relations from this class.

getAuthorizations

AuthorizationDescriptor[] getAuthorizations()
Get authorization descriptors for this class.

Returns:
authorization descriptors.

getAuthorization

AuthorizationDescriptor getAuthorization(java.lang.String aoName)
Get authorization descriptor for given AO.

Parameters:
aoName - AO name.
Returns:
authorization descriptor or null if not associated.

isInstanceOf

boolean isInstanceOf(ClassDescriptor cdesc)
Check for instance of given class.

Parameters:
cdesc - (super)class descriptor.
Returns:
true, if cdesc represents superclass of this class.

getSyncBOSuffix

java.lang.String getSyncBOSuffix()
get SyncBO Suffix

Returns:
SyncBO Suffix, if corresponding SyncBO exists