Class JDOMetaDataPropertyImpl
- java.lang.Object
-
- com.sun.jdo.api.persistence.enhancer.util.Assertion
-
- com.sun.jdo.api.persistence.enhancer.util.Support
-
- com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataPropertyImpl
-
- All Implemented Interfaces:
ExtendedJDOMetaData,JDOMetaData
public class JDOMetaDataPropertyImpl extends Support implements ExtendedJDOMetaData
Provides the JDO meta information based on properties.
-
-
Field Summary
-
Fields inherited from interface com.sun.jdo.api.persistence.enhancer.meta.ExtendedJDOMetaData
CHECK_READ, CHECK_WRITE, MEDIATE_READ, MEDIATE_WRITE, SERIALIZABLE
-
Fields inherited from interface com.sun.jdo.api.persistence.enhancer.meta.JDOMetaData
javaLangCloneablePath, JDOExternalPath, JDOFlagsFieldName, JDOFlagsFieldSig, JDOFlagsFieldType, JDOInstanceCallbacksName, JDOInstanceCallbacksPath, JDOInstanceCallbacksSig, JDOInstanceCallbacksType, JDOPath, JDOPersistenceCapableName, JDOPersistenceCapablePath, JDOPersistenceCapableSig, JDOPersistenceCapableType, JDOPersistenceManagerName, JDOPersistenceManagerPath, JDOPersistenceManagerSig, JDOPersistenceManagerType, JDOSecondClassObjectBaseName, JDOSecondClassObjectBasePath, JDOSecondClassObjectBaseSig, JDOSecondClassObjectBaseType, JDOStateManagerFieldName, JDOStateManagerFieldSig, JDOStateManagerFieldType, JDOStateManagerName, JDOStateManagerPath, JDOStateManagerSig, JDOStateManagerType
-
-
Constructor Summary
Constructors Constructor Description JDOMetaDataPropertyImpl(Properties properties)Creates an instance.JDOMetaDataPropertyImpl(Properties properties, PrintWriter out)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetClassModifiers(String classname)Gets the access modifier of a class.intgetFieldFlags(String classPath, String fieldName)Returns the field flags for a declared field of a class.int[]getFieldFlags(String classPath, String[] fieldNames)Returns the field flags for some declared, managed fields of a class.intgetFieldModifiers(String classname, String fieldname)Gets the access modifier of a field.intgetFieldNo(String classPath, String fieldName)Returns the unique field index of a declared, persistent field of a class.int[]getFieldNo(String classPath, String[] fieldNames)Returns the unique field index of some declared, managed fields of a class.StringgetFieldType(String classname, String fieldname)Gets the type of a field.String[]getFieldType(String classname, String[] fieldnames)Gets the type of some fields.StringgetKeyClass(String classPath)Returns the name of the key class of a class.String[]getKeyFields(String classPath)Returns an array of field names of all key fields of a class.String[]getKnownClasses()No interface method.String[]getKnownFields(String classname)Gets all known fields of a class.String[]getManagedFields(String classname)Returns an array of field names of all declared, persistent fields of a class.StringgetPersistenceCapableRootClass(String classPath)Returns the name of the persistence-capable root class of a class.StringgetPersistenceCapableSuperClass(String classPath)Returns the name of the persistence-capable superclass of a class.StringgetSuperClass(String classname)Returns the superclass of a class.StringgetSuperKeyClass(String classPath)Returns the name of the key class of the next persistence-capable superclass that defines one.booleanisDefaultFetchGroupField(String classPath, String fieldName)Tests whether a field of a class is known to be part of the Default Fetch Group.booleanisKeyField(String classPath, String fieldName)Returns whether a field of a class is key.booleanisKnownNonManagedField(String classPath, String fieldName, String fieldSig)Returns whether a field of a class is known to be non-managed.booleanisManagedField(String classPath, String fieldName)Returns whether a field of a class is transient transactional or persistent.booleanisMutableSecondClassObjectType(String classPath)Tests whether a type is known for Mutable Second Class Objects.booleanisPersistenceCapableClass(String classPath)Tests whether a class is known to be persistence-capable.booleanisPersistenceCapableRootClass(String classPath)Tests whether a class is known as a persistence-capable root class.booleanisPersistentField(String classPath, String fieldName)Tests whether a field of a class is known to be persistent.booleanisPrimaryKeyField(String classPath, String fieldName)Tests whether a field of a class is known to be Primary Key.booleanisSecondClassObjectType(String classPath)Tests whether a type is known for Second Class Objects.booleanisTransactionalField(String classPath, String fieldName)Tests whether a field of a class is known to be transactional.booleanisTransientClass(String classPath)Tests whether a class is known to be transient.-
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
getI18N, getI18N, getI18N, getI18N, getI18N, getI18N
-
-
-
-
Constructor Detail
-
JDOMetaDataPropertyImpl
public JDOMetaDataPropertyImpl(Properties properties, PrintWriter out) throws JDOMetaDataUserException, JDOMetaDataFatalError
Creates an instance. //@lars: out id not used anymore
-
JDOMetaDataPropertyImpl
public JDOMetaDataPropertyImpl(Properties properties) throws JDOMetaDataUserException, JDOMetaDataFatalError
Creates an instance. //@lars: out id not used anymore
-
-
Method Detail
-
isPersistenceCapableClass
public boolean isPersistenceCapableClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a class is known to be persistence-capable.- Specified by:
isPersistenceCapableClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- true if this class is persistence-capable; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isTransientClass
public boolean isTransientClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:JDOMetaDataTests whether a class is known to be transient.The following invariant holds: isTransientClass(classPath) => !isPersistenceCapableClass(classPath)
- Specified by:
isTransientClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- true if this class is known to be transient; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isPersistenceCapableRootClass
public boolean isPersistenceCapableRootClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a class is known as a persistence-capable root class.- Specified by:
isPersistenceCapableRootClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- true if this class is persistence-capable and does not derive from another persistence-capable class; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getPersistenceCapableRootClass
public String getPersistenceCapableRootClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Returns the name of the persistence-capable root class of a class.- Specified by:
getPersistenceCapableRootClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- the name of the least-derived persistence-capable class that is equal to or a super class of the argument class; if the argument class is not persistence-capable, null is returned.
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getSuperClass
public final String getSuperClass(String classname)
Returns the superclass of a class.- Specified by:
getSuperClassin interfaceJDOMetaData- Parameters:
classname- the JVM-qualified name of the class- Returns:
- the name of the superclass.
-
isSecondClassObjectType
public boolean isSecondClassObjectType(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a type is known for Second Class Objects.- Specified by:
isSecondClassObjectTypein interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the type- Returns:
- true if this type is known for second class objects; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isMutableSecondClassObjectType
public boolean isMutableSecondClassObjectType(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a type is known for Mutable Second Class Objects.- Specified by:
isMutableSecondClassObjectTypein interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the type- Returns:
- true if this type is known for mutable second class objects; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isPersistentField
public boolean isPersistentField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a field of a class is known to be persistent.- Specified by:
isPersistentFieldin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- true if this field is known to be persistent; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isTransactionalField
public boolean isTransactionalField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a field of a class is known to be transactional.- Specified by:
isTransactionalFieldin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- true if this field is known to be transactional; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isPrimaryKeyField
public boolean isPrimaryKeyField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a field of a class is known to be Primary Key.- Specified by:
isPrimaryKeyFieldin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- true if this field is known to be primary key; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isDefaultFetchGroupField
public boolean isDefaultFetchGroupField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a field of a class is known to be part of the Default Fetch Group.- Specified by:
isDefaultFetchGroupFieldin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- true if this field is known to be part of the default fetch group; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getFieldNo
public int getFieldNo(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Returns the unique field index of a declared, persistent field of a class.- Specified by:
getFieldNoin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- the non-negative, unique field index
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getManagedFields
public String[] getManagedFields(String classname)
Returns an array of field names of all declared, persistent fields of a class.- Specified by:
getManagedFieldsin interfaceJDOMetaData- Parameters:
classname- the JVM-qualified name of the class- Returns:
- an array of all declared persistent and transactional fields of a class
-
getKnownClasses
public final String[] getKnownClasses()
No interface method.- Specified by:
getKnownClassesin interfaceExtendedJDOMetaData- Returns:
- All known classnames.
-
getKnownFields
public final String[] getKnownFields(String classname)
Gets all known fields of a class.- Specified by:
getKnownFieldsin interfaceExtendedJDOMetaData- Parameters:
classname- The classname.- Returns:
- All known fieldnames.
-
getClassModifiers
public final int getClassModifiers(String classname)
Gets the access modifier of a class.- Specified by:
getClassModifiersin interfaceExtendedJDOMetaData- Parameters:
classname- The classname.- Returns:
- The modifiers.
- See Also:
Modifier
-
getFieldModifiers
public final int getFieldModifiers(String classname, String fieldname)
Gets the access modifier of a field.- Specified by:
getFieldModifiersin interfaceExtendedJDOMetaData- Parameters:
classname- The classname.fieldname- The fieldname.- Returns:
- The modifiers.
- See Also:
Modifier
-
getFieldType
public final String getFieldType(String classname, String fieldname)
Description copied from interface:ExtendedJDOMetaDataGets the type of a field.- Specified by:
getFieldTypein interfaceExtendedJDOMetaData- Parameters:
classname- The classname.fieldname- The fieldname.- Returns:
- The type of the field.
-
getKeyClass
public String getKeyClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns the name of the key class of a class.The following holds: (String s = getKeyClass(classPath)) != null ==> !isPersistenceCapableClass(s) && isPersistenceCapableClass(classPath)
- Specified by:
getKeyClassin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the class- Returns:
- the name of the key class or null if there is none
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError- See Also:
JDOMetaData.isPersistenceCapableClass(String)
-
isKeyField
public boolean isKeyField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns whether a field of a class is key.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().
- Specified by:
isKeyFieldin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the classfieldName- the non-null name of the field- Returns:
- true if this field is key; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError- See Also:
JDOMetaData.isPersistentField(String, String)
-
isKnownNonManagedField
public boolean isKnownNonManagedField(String classPath, String fieldName, String fieldSig)
Description copied from interface:ExtendedJDOMetaDataReturns whether a field of a class is known to be non-managed.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) ==> !isManagedField(classPath, fieldName)
This method doesn't require the field having been declared by declareField().
- Specified by:
isKnownNonManagedFieldin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the classfieldName- the non-null name of the fieldfieldSig- the non-null type signature of the field- Returns:
- true if this field is known to be non-managed; otherwise false
- See Also:
ExtendedJDOMetaData.isManagedField(String, String)
-
isManagedField
public boolean isManagedField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns whether a field of a class is transient transactional or persistent.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) && (isPersistentField(classPath, fieldName) ^ isTransactionalField(classPath, fieldName))
This method requires the field having been declared by declareField().
- Specified by:
isManagedFieldin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the classfieldName- the non-null name of the field- Returns:
- true if this field is managed; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError- See Also:
ExtendedJDOMetaData.isKnownNonManagedField(String, String, String),JDOMetaData.isPersistentField(String, String),JDOMetaData.isPersistenceCapableClass(String)
-
getFieldFlags
public int getFieldFlags(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns the field flags for a declared field of a class.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) isTransientField(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().
- Specified by:
getFieldFlagsin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the classfieldName- the non-null name of the field- Returns:
- the field flags for this field
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getFieldFlags
public int[] getFieldFlags(String classPath, String[] fieldNames) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns the field flags for some declared, managed fields of a class.This method requires all fields having been declared by declareField().
- Specified by:
getFieldFlagsin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the classfieldNames- the non-null array of names of the declared fields- Returns:
- the field flags for the fields
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getFieldType
public final String[] getFieldType(String classname, String[] fieldnames)
Description copied from interface:ExtendedJDOMetaDataGets the type of some fields.- Specified by:
getFieldTypein interfaceExtendedJDOMetaData- Parameters:
classname- The classname.fieldnames- The fieldnames.- Returns:
- The type of the fields.
-
getFieldNo
public int[] getFieldNo(String classPath, String[] fieldNames) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns the unique field index of some declared, managed fields of a class.This method requires all fields having been declared by declareField().
- Specified by:
getFieldNoin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the classfieldNames- the non-null array of names of the declared fields- Returns:
- the non-negative, unique field indices
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getKeyFields
public String[] getKeyFields(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns an array of field names of all key fields of a class.This method requires all fields having been declared by declareField().
- Specified by:
getKeyFieldsin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the class- Returns:
- an array of all declared key fields of a class
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getPersistenceCapableSuperClass
public String getPersistenceCapableSuperClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns the name of the persistence-capable superclass of a class.The following holds: (String s = getPersistenceCapableSuperClass(classPath)) != null ==> isPersistenceCapableClass(classPath) && !isPersistenceCapableRootClass(classPath)
- Specified by:
getPersistenceCapableSuperClassin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the class- Returns:
- the name of the PC superclass or null if there is none
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError- See Also:
JDOMetaData.isPersistenceCapableClass(String),JDOMetaData.getPersistenceCapableRootClass(String)
-
getSuperKeyClass
public String getSuperKeyClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaDataReturns the name of the key class of the next persistence-capable superclass that defines one.The following holds: (String s = getSuperKeyClass(classPath)) != null ==> !isPersistenceCapableClass(s) && isPersistenceCapableClass(classPath) && !isPersistenceCapableRootClass(classPath)
- Specified by:
getSuperKeyClassin interfaceExtendedJDOMetaData- Parameters:
classPath- the non-null JVM-qualified name of the class- Returns:
- the name of the key class or null if there is none
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError- See Also:
ExtendedJDOMetaData.getKeyClass(String),ExtendedJDOMetaData.getPersistenceCapableSuperClass(String)
-
-