org.apache.jdo.impl.enhancer.meta.util
Class EnhancerMetaDataBaseModel

java.lang.Object
  extended byorg.apache.jdo.impl.enhancer.util.Assertion
      extended byorg.apache.jdo.impl.enhancer.util.Support
          extended byorg.apache.jdo.impl.enhancer.meta.util.EnhancerMetaDataBaseModel
All Implemented Interfaces:
EnhancerMetaData
Direct Known Subclasses:
EnhancerMetaDataJDOModelImpl, EnhancerMetaDataPropertyImpl

public abstract class EnhancerMetaDataBaseModel
extends Support
implements EnhancerMetaData

Provides the JDO meta information based on a JDO meta model.


Field Summary
protected  java.io.PrintWriter out
           
protected static java.util.HashSet unenhancableTypePrefixes
           
protected  boolean verbose
           
 
Fields inherited from class org.apache.jdo.impl.enhancer.util.Support
timer
 
Fields inherited from interface org.apache.jdo.impl.enhancer.meta.EnhancerMetaData
CHECK_READ, CHECK_WRITE, MEDIATE_READ, MEDIATE_WRITE, SERIALIZABLE
 
Constructor Summary
EnhancerMetaDataBaseModel(java.io.PrintWriter out, boolean verbose)
          Creates an instance.
 
Method Summary
 int getFieldFlags(java.lang.String classPath, java.lang.String fieldName)
          Returns the field flags of a declared, managed 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[] fieldNames)
          Returns the unique field index of some declared, managed fields 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 getPersistenceCapableRootClass(java.lang.String classPath)
          Returns the name of the persistence-capable root class 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 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 known to be either transient transactional or persistent.
 boolean isPersistenceCapableRootClass(java.lang.String classPath)
          Returns whether a class is persistence-capable root class.
 void printMessage(java.lang.String msg)
          Prints out a verbose message.
 void printWarning(java.lang.String msg)
          Prints out a warning message.
 
Methods inherited from class org.apache.jdo.impl.enhancer.util.Support
getI18N, getI18N, getI18N, getI18N, getI18N, getI18N
 
Methods inherited from class org.apache.jdo.impl.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
 
Methods inherited from interface org.apache.jdo.impl.enhancer.meta.EnhancerMetaData
declareField, getDeclaringClass, getFieldNumber, getKeyClass, getManagedFields, getPersistenceCapableSuperClass, isDefaultFetchGroupField, isKeyField, isKnownNonManagedField, isPersistenceCapableClass, isPersistentField, isSerializableClass, isTransactionalField
 

Field Detail

verbose

protected boolean verbose

out

protected final java.io.PrintWriter out

unenhancableTypePrefixes

protected static final java.util.HashSet unenhancableTypePrefixes
Constructor Detail

EnhancerMetaDataBaseModel

public EnhancerMetaDataBaseModel(java.io.PrintWriter out,
                                 boolean verbose)
                          throws EnhancerMetaDataUserException,
                                 EnhancerMetaDataFatalError
Creates an instance.

Method Detail

printWarning

public void printWarning(java.lang.String msg)
Prints out a warning message.

Parameters:
msg - the message

printMessage

public void printMessage(java.lang.String msg)
Prints out a verbose message.

Parameters:
msg - the message

isKnownUnenhancableClass

public boolean isKnownUnenhancableClass(java.lang.String classPath)
                                 throws EnhancerMetaDataUserException,
                                        EnhancerMetaDataFatalError
Returns whether a class is not to be modified by the enhancer.

Specified by:
isKnownUnenhancableClass in interface EnhancerMetaData
Parameters:
classPath - the non-null JVM-qualified name of the class
Returns:
true if this class is known to be unmodifiable; otherwise false
Throws:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.isKnownUnenhancableClass(String)

isPersistenceCapableRootClass

public boolean isPersistenceCapableRootClass(java.lang.String classPath)
                                      throws EnhancerMetaDataUserException,
                                             EnhancerMetaDataFatalError
Returns whether a class is persistence-capable root class.

Specified by:
isPersistenceCapableRootClass in interface EnhancerMetaData
Parameters:
classPath - the non-null 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:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.isPersistenceCapableRootClass(String)

getPersistenceCapableRootClass

public java.lang.String getPersistenceCapableRootClass(java.lang.String classPath)
                                                throws EnhancerMetaDataUserException,
                                                       EnhancerMetaDataFatalError
Returns the name of the persistence-capable root class of a class.

Specified by:
getPersistenceCapableRootClass in interface EnhancerMetaData
Parameters:
classPath - the non-null 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:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.getPersistenceCapableRootClass(String)

getSuperKeyClass

public java.lang.String getSuperKeyClass(java.lang.String classPath)
                                  throws EnhancerMetaDataUserException,
                                         EnhancerMetaDataFatalError
Returns the name of the key class of the next persistence-capable superclass that defines one.

Specified by:
getSuperKeyClass in interface EnhancerMetaData
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:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.getSuperKeyClass(String)

isManagedField

public boolean isManagedField(java.lang.String classPath,
                              java.lang.String fieldName)
                       throws EnhancerMetaDataUserException,
                              EnhancerMetaDataFatalError
Returns whether a field of a class is known to be either transient transactional or persistent.

Specified by:
isManagedField in interface EnhancerMetaData
Parameters:
classPath - the non-null JVM-qualified name of the class
fieldName - the non-null name of the field
Returns:
true if this field is managed; otherwise false
Throws:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.isManagedField(String, String)

getFieldFlags

public int getFieldFlags(java.lang.String classPath,
                         java.lang.String fieldName)
                  throws EnhancerMetaDataUserException,
                         EnhancerMetaDataFatalError
Returns the field flags of a declared, managed field of a class.

Specified by:
getFieldFlags in interface EnhancerMetaData
Parameters:
classPath - the non-null JVM-qualified name of the class
fieldName - the non-null name of the field
Returns:
the field flags for this field
Throws:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.getFieldFlags(String, String)

getKeyFields

public java.lang.String[] getKeyFields(java.lang.String classPath)
                                throws EnhancerMetaDataUserException,
                                       EnhancerMetaDataFatalError
Returns an array of field names of all key fields of a class.

Specified by:
getKeyFields in interface EnhancerMetaData
Parameters:
classPath - the non-null JVM-qualified name of the class
Returns:
an array of all declared key fields of a class
Throws:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.getKeyFields(String)

getFieldFlags

public int[] getFieldFlags(java.lang.String classPath,
                           java.lang.String[] fieldNames)
                    throws EnhancerMetaDataUserException,
                           EnhancerMetaDataFatalError
Returns the field flags for some declared, managed fields of a class.

Specified by:
getFieldFlags in interface EnhancerMetaData
Parameters:
classPath - the non-null JVM-qualified name of the class
fieldNames - the non-null array of names of the declared fields
Returns:
the field flags for the fields
Throws:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.getFieldFlags(String, String[])

getFieldNumber

public int[] getFieldNumber(java.lang.String classPath,
                            java.lang.String[] fieldNames)
                     throws EnhancerMetaDataUserException,
                            EnhancerMetaDataFatalError
Returns the unique field index of some declared, managed fields of a class.

Specified by:
getFieldNumber in interface EnhancerMetaData
Parameters:
classPath - the non-null JVM-qualified name of the class
fieldNames - the non-null array of names of the declared fields
Returns:
the non-negative, unique field indices
Throws:
EnhancerMetaDataUserException
EnhancerMetaDataFatalError
See Also:
EnhancerMetaData.getFieldNumber(String, String[])


Copyright © 2005 Apache Software Foundation. All Rights Reserved.