public interface EnhancerMetaData
Please note: This interface deals with fully qualified names in the JVM notation, that is, with '/' as package separator character (instead of '.').
| Modifier and Type | Field and Description |
|---|---|
static int |
CHECK_READ
The JDO field flags.
|
static int |
CHECK_WRITE |
static int |
MEDIATE_READ |
static int |
MEDIATE_WRITE |
static int |
SERIALIZABLE |
| Modifier and Type | Method and Description |
|---|---|
void |
declareField(java.lang.String classPath,
java.lang.String fieldName,
java.lang.String fieldSig)
Declares a field to the JDO model passing its type information.
|
java.lang.String |
getDeclaringClass(java.lang.String classPath,
java.lang.String fieldName)
Returns the JVM-qualified name of the specified field's declaring
class.
|
int |
getFieldFlags(java.lang.String classPath,
java.lang.String fieldName)
Returns the field flags for a declared field of a class.
|
int[] |
getFieldFlags(java.lang.String classPath,
java.lang.String[] fieldNames)
Returns the field flags for some declared, managed fields of a class.
|
int |
getFieldNumber(java.lang.String classPath,
java.lang.String fieldName)
Returns the unique field index of a declared, managed field of a
class.
|
int[] |
getFieldNumber(java.lang.String classPath,
java.lang.String[] fieldNames)
Returns the unique field index of some declared, managed fields of a
class.
|
java.lang.String |
getKeyClass(java.lang.String classPath)
Returns the name of the key class of a class.
|
java.lang.String[] |
getKeyFields(java.lang.String classPath)
Returns an array of field names of all key fields of a class.
|
java.lang.String[] |
getManagedFields(java.lang.String classPath)
Returns an array of field names of all declared persistent and
transactional fields of a class.
|
java.lang.String |
getPersistenceCapableRootClass(java.lang.String classPath)
Returns the name of the persistence-capable root class of a class.
|
java.lang.String |
getPersistenceCapableSuperClass(java.lang.String classPath)
Returns the name of the persistence-capable superclass of a class.
|
java.lang.String |
getSuperKeyClass(java.lang.String classPath)
Returns the name of the key class of the next persistence-capable
superclass that defines one.
|
boolean |
isDefaultFetchGroupField(java.lang.String classPath,
java.lang.String fieldName)
Returns whether a field of a class is part of the
default fetch group.
|
boolean |
isKeyField(java.lang.String classPath,
java.lang.String fieldName)
Returns whether a field of a class is key.
|
boolean |
isKnownNonManagedField(java.lang.String classPath,
java.lang.String fieldName,
java.lang.String fieldSig)
Returns whether a field of a class is known to be non-managed.
|
boolean |
isKnownUnenhancableClass(java.lang.String classPath)
Returns whether a class is not to be modified by the enhancer.
|
boolean |
isManagedField(java.lang.String classPath,
java.lang.String fieldName)
Returns whether a field of a class is transient transactional
or persistent.
|
boolean |
isPersistenceCapableClass(java.lang.String classPath)
Returns whether a class is persistence-capable.
|
boolean |
isPersistenceCapableRootClass(java.lang.String classPath)
Returns whether a class is persistence-capable root class.
|
boolean |
isPersistentField(java.lang.String classPath,
java.lang.String fieldName)
Returns whether a field of a class is persistent.
|
boolean |
isSerializableClass(java.lang.String classPath)
Returns whether a class implements java.io.Serializable.
|
boolean |
isTransactionalField(java.lang.String classPath,
java.lang.String fieldName)
Returns whether a field of a class is transient
transactional.
|
static final int CHECK_READ
static final int MEDIATE_READ
static final int CHECK_WRITE
static final int MEDIATE_WRITE
static final int SERIALIZABLE
boolean isKnownUnenhancableClass(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
It is an error if an unenhanceable class is persistence-capable (or persistence-aware). The following holds: isKnownUnenhancableClass(classPath) ==> !isPersistenceCapableClass(classPath)
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisPersistenceCapableClass(String)boolean isPersistenceCapableClass(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
If a persistence-capable class is also known to be unenhancable, an exception is thrown. The following holds: isPersistenceCapableClass(classPath) ==> !isKnownUnenhancableClass(classPath)
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisKnownUnenhancableClass(String)boolean isSerializableClass(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorjava.lang.String getPersistenceCapableSuperClass(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
The following holds: (String s = getPersistenceCapableSuperClass(classPath)) != null ==> isPersistenceCapableClass(classPath) && !isPersistenceCapableRootClass(classPath)
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisPersistenceCapableClass(String),
getPersistenceCapableRootClass(String)java.lang.String getKeyClass(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
The following holds: (String s = getKeyClass(classPath)) != null ==> !isPersistenceCapableClass(s) && isPersistenceCapableClass(classPath)
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisPersistenceCapableClass(String)java.lang.String[] getManagedFields(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
The position of the field names in the result array corresponds to their unique field index as returned by getFieldNumber such that these equations hold:
getFieldNumber(getManagedFields(classPath)[i]) == i
getManagedFields(classPath)[getFieldNumber(fieldName)] == fieldName
This method requires all fields having been declared by declareField().
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorgetFieldNumber(String, String),
declareField(String, String, String)java.lang.String getDeclaringClass(java.lang.String classPath,
java.lang.String fieldName)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
null for an unkown field.classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldnull if there is no such field.EnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorvoid declareField(java.lang.String classPath,
java.lang.String fieldName,
java.lang.String fieldSig)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
By the new JDO model, it's a requirement to declare fields to the model for their type information before any field information based on persistence-modifiers can be retrieved. This method passes a field's type information to the underlying JDO model.
There's one important exception: The method isKnownNonManagedField() may be called at any time.
The class must be persistence-capable, otherwise an exception is thrown.
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldfieldSig - the non-null JVM signature of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisPersistenceCapableClass(String)boolean isKnownNonManagedField(java.lang.String classPath,
java.lang.String fieldName,
java.lang.String fieldSig)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
This method differs from isManagedField() in that a field may or may not be managed if its not known as non-managed. The following holds (not vice versa!): isKnownNonManagedField(classPath, fieldName, fieldSig) ==> !isManagedField(classPath, fieldName)
This method doesn't require the field having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldfieldSig - the non-null type signature of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisManagedField(String, String),
declareField(String, String, String)boolean isManagedField(java.lang.String classPath,
java.lang.String fieldName)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
A managed field must not be known as non-managed and must be either transient transactional or persistent. The following holds: isManagedField(classPath, fieldName) ==> !isKnownNonManagedField(classPath, fieldName, fieldSig) && (isPersistentField(classPath, fieldName) ^ isTransactionalField(classPath, fieldName))
This method requires the field having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisKnownNonManagedField(String, String, String),
isPersistentField(String, String),
isTransactionalField(String, String),
isPersistenceCapableClass(String)boolean isTransactionalField(java.lang.String classPath,
java.lang.String fieldName)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
A transient transactional field cannot be persistent. The following holds: isTransactionalField(classPath, fieldName) ==> isManagedField(classPath, fieldName) && !isPersistentField(classPath, fieldName)
This method requires the field having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisManagedField(String, String),
declareField(String, String, String)boolean isPersistentField(java.lang.String classPath,
java.lang.String fieldName)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
A persistent field cannot be transient transactional. The following holds: isPersistentField(classPath, fieldName) ==> isManagedField(classPath, fieldName) && !isTransactionalField(classPath, fieldName)
This method requires the field having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisManagedField(String, String),
declareField(String, String, String)boolean isKeyField(java.lang.String classPath,
java.lang.String fieldName)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
A key field must be persistent. The following holds: isKeyField(classPath, fieldName) ==> isPersistentField(classPath, fieldName) && !isDefaultFetchGroupField(classPath, fieldName)
This method requires the field having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisPersistentField(String, String),
declareField(String, String, String)boolean isDefaultFetchGroupField(java.lang.String classPath,
java.lang.String fieldName)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
A field in the default fetch group must be persistent. The following holds: isDefaultFetchGroupField(classPath, fieldName) ==> isPersistentField(classPath, fieldName) && !isKeyField(classPath, fieldName)
This method requires the field having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorisPersistentField(String, String),
declareField(String, String, String)int getFieldNumber(java.lang.String classPath,
java.lang.String fieldName)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
The following holds: int i = getFieldFlags(classPath, fieldName); i > 0 ==> getManagedFields(classPath)[i] == fieldName
This method requires the field having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorgetManagedFields(String),
declareField(String, String, String)int getFieldFlags(java.lang.String classPath,
java.lang.String fieldName)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
The following holds for the field flags: int f = getFieldFlags(classPath, fieldName); !isManagedField(classPath, fieldName) ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) && (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE == 0) isTransactionalField(classPath, fieldName) ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) && (f & CHECK_WRITE != 0) && (f & MEDIATE_WRITE == 0) isKeyField(classPath, fieldName) ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) && (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE != 0) isDefaultFetchGroupField(classPath, fieldName) ==> (f & CHECK_READ != 0) && (f & MEDIATE_READ != 0) && (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE == 0) isPersistentField(classPath, fieldName) && isKeyField(classPath, fieldName) && isDefaultFetchGroupField(classPath, fieldName) ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) && (f & CHECK_WRITE != 0) && (f & MEDIATE_WRITE != 0)
This method requires the field having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldName - the non-null name of the fieldEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrordeclareField(String, String, String)boolean isPersistenceCapableRootClass(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
The following holds: isPersistenceCapableRootClass(classPath) <==> isPersistenceCapableClass(classPath) && getPersistenceCapableSuperClass(classPath) == null
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorjava.lang.String getPersistenceCapableRootClass(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
The following holds: (String s = getPersistenceCapableRootClass(classPath)) != null ==> isPersistenceCapableClass(classPath) && getPersistenceCapableSuperClass(classPath) == null
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorjava.lang.String getSuperKeyClass(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
The following holds: (String s = getSuperKeyClass(classPath)) != null ==> !isPersistenceCapableClass(s) && isPersistenceCapableClass(classPath) && !isPersistenceCapableRootClass(classPath)
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrorgetKeyClass(String),
getPersistenceCapableSuperClass(String)java.lang.String[] getKeyFields(java.lang.String classPath)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
This method requires all fields having been declared by declareField().
classPath - the non-null JVM-qualified name of the classEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrordeclareField(String, String, String)int[] getFieldNumber(java.lang.String classPath,
java.lang.String[] fieldNames)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
This method requires all fields having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldNames - the non-null array of names of the declared fieldsEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrordeclareField(String, String, String)int[] getFieldFlags(java.lang.String classPath,
java.lang.String[] fieldNames)
throws EnhancerMetaDataUserException,
EnhancerMetaDataFatalError
This method requires all fields having been declared by declareField().
classPath - the non-null JVM-qualified name of the classfieldNames - the non-null array of names of the declared fieldsEnhancerMetaDataUserExceptionEnhancerMetaDataFatalErrordeclareField(String, String, String)Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.