com.sun.jdo.api.persistence.enhancer.meta
Class JDOMetaDataTimer

java.lang.Object
  extended by com.sun.jdo.api.persistence.enhancer.util.Assertion
      extended by com.sun.jdo.api.persistence.enhancer.util.Support
          extended by com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataTimer
All Implemented Interfaces:
JDOMetaData

public final class JDOMetaDataTimer
extends Support
implements JDOMetaData


Field Summary
protected  JDOMetaData delegate
           
 
Fields inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
timer
 
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
JDOMetaDataTimer(JDOMetaData delegate)
          Creates an instance.
 
Method Summary
 int getFieldNo(String classPath, String fieldName)
          Returns the unique field index of a declared, persistent field of a class.
 String[] getManagedFields(String classPath)
          Returns an array of field names of all declared persistent and transactional fields of a class.
 String getPersistenceCapableRootClass(String classPath)
          Returns the name of the persistence-capable root class of a class.
 String getSuperClass(String classPath)
          Returns the name of the superclass of a class.
 boolean isDefaultFetchGroupField(String classPath, String fieldName)
          Tests whether a field of a class is known to be part of the Default Fetch Group.
 boolean isMutableSecondClassObjectType(String classPath)
          Tests whether a class is known as type for Mutable Second Class Objects.
 boolean isPersistenceCapableClass(String classPath)
          Tests whether a class is known to be persistence-capable.
 boolean isPersistenceCapableRootClass(String classPath)
          Tests whether a class is known as a persistence-capable root class.
 boolean isPersistentField(String classPath, String fieldName)
          Tests whether a field of a class is known to be persistent.
 boolean isPrimaryKeyField(String classPath, String fieldName)
          Tests whether a field of a class is known to be Primary Key.
 boolean isSecondClassObjectType(String classPath)
          Tests whether a class is known as type for Second Class Objects.
 boolean isTransactionalField(String classPath, String fieldName)
          Tests whether a field of a class is known to be transactional.
 boolean isTransientClass(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
 
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Assertion
affirm, affirm, affirm, affirm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected final JDOMetaData delegate
Constructor Detail

JDOMetaDataTimer

public JDOMetaDataTimer(JDOMetaData delegate)
                 throws JDOMetaDataUserException,
                        JDOMetaDataFatalError
Creates an instance.

Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
Method Detail

isPersistenceCapableClass

public boolean isPersistenceCapableClass(String classPath)
                                  throws JDOMetaDataUserException,
                                         JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a class is known to be persistence-capable.

The following invariant holds: isPersistenceCapableClass(classPath) => !isTransientClass(classPath) && !isSecondClassObjectType(classPath)

Specified by:
isPersistenceCapableClass in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
Returns:
true if this class is persistence-capable; otherwise false
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

isTransientClass

public boolean isTransientClass(String classPath)
                         throws JDOMetaDataUserException,
                                JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a class is known to be transient.

The following invariant holds: isTransientClass(classPath) => !isPersistenceCapableClass(classPath)

Specified by:
isTransientClass in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
Returns:
true if this class is known to be transient; otherwise false
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

isPersistenceCapableRootClass

public boolean isPersistenceCapableRootClass(String classPath)
                                      throws JDOMetaDataUserException,
                                             JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a class is known as a persistence-capable root class.

Specified by:
isPersistenceCapableRootClass in interface JDOMetaData
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:
JDOMetaDataUserException
JDOMetaDataFatalError

getSuperClass

public String getSuperClass(String classPath)
                     throws JDOMetaDataUserException,
                            JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Returns the name of the superclass of a class.

Specified by:
getSuperClass in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
Returns:
the name of the superclass.
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

getPersistenceCapableRootClass

public String getPersistenceCapableRootClass(String classPath)
                                      throws JDOMetaDataUserException,
                                             JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Returns the name of the persistence-capable root class of a class.

Specified by:
getPersistenceCapableRootClass in interface JDOMetaData
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:
JDOMetaDataUserException
JDOMetaDataFatalError

isSecondClassObjectType

public boolean isSecondClassObjectType(String classPath)
                                throws JDOMetaDataUserException,
                                       JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a class is known as type for Second Class Objects.

The following invariant holds: isSecondClassObjectType(classPath) => !isPersistenceCapableClass(classPath)

Specified by:
isSecondClassObjectType in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the type
Returns:
true if this type is known for second class objects; otherwise false
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

isMutableSecondClassObjectType

public boolean isMutableSecondClassObjectType(String classPath)
                                       throws JDOMetaDataUserException,
                                              JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a class is known as type for Mutable Second Class Objects.

Specified by:
isMutableSecondClassObjectType in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the type
Returns:
true if this type is known for mutable second class objects; otherwise false
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

isPersistentField

public boolean isPersistentField(String classPath,
                                 String fieldName)
                          throws JDOMetaDataUserException,
                                 JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a field of a class is known to be persistent.

Specified by:
isPersistentField in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
fieldName - the name of the field
Returns:
true if this field is known to be persistent; otherwise false
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

isTransactionalField

public boolean isTransactionalField(String classPath,
                                    String fieldName)
                             throws JDOMetaDataUserException,
                                    JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a field of a class is known to be transactional.

Specified by:
isTransactionalField in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
fieldName - the name of the field
Returns:
true if this field is known to be transactional; otherwise false
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

isPrimaryKeyField

public boolean isPrimaryKeyField(String classPath,
                                 String fieldName)
                          throws JDOMetaDataUserException,
                                 JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a field of a class is known to be Primary Key.

Specified by:
isPrimaryKeyField in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
fieldName - the name of the field
Returns:
true if this field is known to be primary key; otherwise false
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

isDefaultFetchGroupField

public boolean isDefaultFetchGroupField(String classPath,
                                        String fieldName)
                                 throws JDOMetaDataUserException,
                                        JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Tests whether a field of a class is known to be part of the Default Fetch Group.

Specified by:
isDefaultFetchGroupField in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
fieldName - the name of the field
Returns:
true if this field is known to be part of the default fetch group; otherwise false
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

getFieldNo

public int getFieldNo(String classPath,
                      String fieldName)
               throws JDOMetaDataUserException,
                      JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Returns the unique field index of a declared, persistent field of a class.

Specified by:
getFieldNo in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
fieldName - the name of the field
Returns:
the non-negative, unique field index
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError

getManagedFields

public String[] getManagedFields(String classPath)
                          throws JDOMetaDataUserException,
                                 JDOMetaDataFatalError
Description copied from interface: JDOMetaData
Returns an array of field names of all declared persistent and transactional fields of a class.

The position of the field names in the result array corresponds to their unique field index as returned by getFieldNo such that these equations holds:

getFieldNo(getManagedFields(classPath)[i]) == i

getManagedFields(classPath)[getFieldNo(fieldName)] == fieldName

Specified by:
getManagedFields in interface JDOMetaData
Parameters:
classPath - the JVM-qualified name of the class
Returns:
an array of all declared persistent and transactional fields of a class
Throws:
JDOMetaDataUserException
JDOMetaDataFatalError


Copyright © 2012. All Rights Reserved.