public abstract class Model extends Object
Modifier and Type | Field and Description |
---|---|
static Model |
ENHANCER
Default instance of the model used by the enhancer.
|
static String |
messageBase
I18N message base
|
static String[] |
NO_ARGS
Standard set of empty arguments (for comparison with hashCode method
and no-arg constructor).
|
static Model |
RUNTIME
Default instance of the model for use at runtime.
|
Constructor and Description |
---|
Model() |
Modifier and Type | Method and Description |
---|---|
boolean |
addFieldElement(PersistenceClassElement element,
String fieldName)
Adds a PersistenceFieldElement for the specified field to the
supplied PersistenceClassElement, creating a RelationshipElement if
necessary.
|
void |
convertDefaultFields(String className)
Adds the default allowable persistent fields to the persistent class
with the specified name.
|
void |
convertFields(String className,
List fields)
Adds the allowable persistent fields from the supplied list
to the persistent class with the specified name.
|
void |
convertToPersistenceCapable(String className)
Converts the class with the supplied name to persistence-capable,
then convert its default fields and save it to the xml file.
|
void |
convertToPersistenceCapable(String className,
boolean flag)
Converts the class with the supplied name to or from persistence
capable depending on the flag.
|
protected abstract BufferedOutputStream |
createFile(String className,
String baseFileName,
String extension)
Creates a file with the given base file name and extension
parallel to the supplied class (if it does not yet exist).
|
protected abstract void |
deleteFile(String className,
String fileName)
Deletes the file with the given file name which is parallel
to the supplied class.
|
protected abstract String |
findPenultimateSuperclass(String className)
Returns the name of the second to top (top excluding java.lang.Object)
superclass for the given class name.
|
List |
getAllFields(String className)
Returns a list of names of all the field elements in the
class with the specified name.
|
Object |
getClass(String className)
Returns the class element with the specified className.
|
abstract Object |
getClass(String className,
ClassLoader classLoader)
Returns the class element with the specified className.
|
Map |
getClassLoaderCache()
Returns an unmodifiable copy of the ClassLoader cache.
|
abstract Object |
getConstructor(String className,
String[] argTypeNames)
Returns the constructor element for the specified argument types
in the class with the specified name.
|
abstract String |
getDeclaringClass(Object memberElement)
Returns the string representation of declaring class of
the specified member element.
|
String |
getDefaultCollectionClass(String className)
Returns the default collection class for the specified class.
|
static String[] |
getEqualsArgs()
Standard set of arguments for comparison with equals method.
|
abstract Object |
getField(String className,
String fieldName)
Returns the field element for the specified fieldName in the class
with the specified className.
|
abstract List |
getFields(String className)
Returns a list of names of all the declared field elements in the
class with the specified name.
|
String |
getFieldType(String className,
String fieldName)
Returns the field type for the specified fieldName in the class
with the specified className.
|
protected String |
getFileName(String className)
Computes the base file name (without extension) for the supplied
class name by converting the package name to a path name.
|
protected String |
getFileNameWithExtension(String className)
Computes the mapping file name (with extension) for the supplied
class name by converting the package name to a path name.
|
Object |
getInheritedField(String className,
String fieldName)
Returns the inherited field element for the specified fieldName in
the class with the specified className.
|
Object |
getInheritedMethod(String className,
String methodName,
String[] argTypeNames)
Returns the inherited method element for the specified method
name and argument types in the class with the specified name.
|
protected abstract BufferedInputStream |
getInputStreamForResource(String className,
ClassLoader classLoader,
String resourceName)
Returns the input stream with the supplied resource name found with
the supplied class name.
|
Map |
getMappingCache()
Returns an unmodifiable copy of the MappingClassElement cache.
|
MappingClassElement |
getMappingClass(String className)
Returns the MappingClassElement created for the specified class name.
|
MappingClassElement |
getMappingClass(String className,
ClassLoader classLoader)
Returns the MappingClassElement created for the specified class name.
|
protected static ResourceBundle |
getMessages() |
abstract Object |
getMethod(String className,
String methodName,
String[] argTypeNames)
Returns the method element for the specified method name and argument
types in the class with the specified name.
|
abstract int |
getModifiers(Object memberElement)
Returns the modifier mask for the specified member element.
|
protected int |
getModifiers(String className,
String fieldName)
Returns the modifier mask for the specified fieldName in the class
with the specified className.
|
int |
getModifiersForClass(String className)
Returns the modifier mask for the specified className.
|
protected PersistenceClassElement |
getPersistenceClass(MappingClassElement mappingClass)
Returns a PersistenceClassElement created from the mapping class.
|
PersistenceClassElement |
getPersistenceClass(String className)
Returns a PersistenceClassElement created from the specified class name.
|
PersistenceClassElement |
getPersistenceClass(String className,
ClassLoader classLoader)
Returns a PersistenceClassElement created from the specified class name.
|
PersistenceFieldElement |
getPersistenceField(String className,
String fieldName)
Returns the PersistenceFieldElement with the supplied fieldName found
in the supplied className.
|
protected PersistenceFieldElement |
getPersistenceFieldInternal(String className,
String fieldName)
Returns the PersistenceFieldElement with the supplied fieldName found
in the supplied className.
|
static String[] |
getReadObjectArgs()
Standard set of arguments for comparison with readObject method.
|
String |
getRelatedClass(RelationshipElement element)
Gets the name of the related class for a relationship element.
|
protected String |
getResourceName(String className)
Computes the base resource name (without extension) for the supplied
class name by converting the package name to a resource name.
|
protected String |
getResourceNameWithExtension(String className)
Computes the mapping file resource name (with extension) for the
supplied class name by converting the package name to a resource name.
|
protected abstract String |
getSuperclass(String className)
Returns the name of the superclass for the given class name.
|
ArrayList |
getSupportedCollectionClasses(String className)
Computes the list of names of the possible collection classes for the
specified class.
|
abstract String |
getType(Object element)
Returns the string representation of type of the specified element.
|
static String[] |
getWriteObjectArgs()
Standard set of arguments for comparison with writeObject method.
|
boolean |
hasClass(String className)
Determines if a class with the specified className exists.
|
boolean |
hasClass(String className,
ClassLoader classLoader)
Determines if a class with the specified className exists.
|
abstract boolean |
hasConstructor(String className)
Determines if the class with the specified name declares a constructor.
|
boolean |
hasField(String className,
String fieldName)
Determines if a field with the specified fieldName exists in the class
with the specified className.
|
boolean |
hasPersistentSuperclass(String className)
Determines if the specified className has a persistent superclass.
|
abstract boolean |
implementsInterface(Object classElement,
String interfaceName)
Determines if the specified class implements the specified interface.
|
abstract boolean |
isArray(String className,
String fieldName)
Determines if a field with the specified fieldName in the class
with the specified className is an array.
|
protected boolean |
isByteArray(String className)
Determines if the specified className represents a byte array.
|
boolean |
isByteArray(String className,
String fieldName)
Determines if a field with the specified fieldName in the class
with the specified className is a byte array.
|
boolean |
isCollection(String className)
Determines if the class name represents a collection.
|
boolean |
isDefaultFetchGroup(String className,
String fieldName)
Determines if the specified className and fieldName pair represent a
field which is part of the default fetch group.
|
abstract boolean |
isInterface(String className)
Determines if the specified className represents an interface type.
|
boolean |
isKey(String className,
String fieldName)
Determines if the specified className and fieldName pair represent a
key field.
|
boolean |
isMutableSecondClassObject(String className)
Determines if the specified className represents a mutable second class
object.
|
boolean |
isPersistenceCapableAllowed(String className)
Determines if the specified className represents a legal candidate for
becoming a persistence capable class.
|
boolean |
isPersistent(String className)
Determines if the specified className represents a persistence capable
class.
|
boolean |
isPersistent(String className,
ClassLoader classLoader)
Determines if the specified className represents a persistence capable
class.
|
boolean |
isPersistent(String className,
String fieldName)
Determines if the specified className and fieldName pair represent a
persistent field.
|
boolean |
isPersistentAllowed(String className,
ClassLoader classLoader,
String fieldName)
Returns
true if the specified field can be made
persistent, false otherwise. |
boolean |
isPersistentAllowed(String className,
String fieldName)
Returns
true if the specified field can be made
persistent, false otherwise. |
protected boolean |
isPersistentTypeAllowed(String className,
ClassLoader classLoader)
Returns
true if the a field of the specified class or
type can be made persistent, false otherwise. |
protected boolean |
isPrimitive(String className)
Determines if the specified className represents a primitive type.
|
boolean |
isPrimitive(String className,
String fieldName)
Determines if a field with the specified fieldName in the class
with the specified className has a primitive type.
|
boolean |
isSecondClassObject(String className)
Determines if the specified className represents a second class object.
|
abstract boolean |
isSerializable(Object fieldElement)
Determines if the specified field element has a serializable type.
|
boolean |
isValidKeyType(String className,
String fieldName)
Determines if the specified className and fieldName pair represent a
field which has a type which is valid for key fields.
|
void |
lockFile(String className) |
protected static Model |
NewModel(String testName,
String modelName)
Create a new Model of the requested type.
|
boolean |
parse(String className)
Parses the combination of java (or class) information and mapping/jdo
information by running through a subset of the full validation check
and aborting (and returning
false at the first error or
warning. |
void |
removeFieldElement(PersistenceFieldElement element)
Removes the specified PersistenceFieldElement from its declaring
class.
|
void |
removeFromCache(String className)
Removes the class with the supplied name from the cache of
classes known to be non PC.
|
void |
removeResourcesFromCaches(ClassLoader classLoader)
Removes the classes cached with the specified class loader from all
caches.
|
protected void |
removeResourcesFromCaches(Collection classNames)
Removes the specified classes from all caches.
|
boolean |
shouldBePersistent(String className,
String fieldName)
Returns
true if the specified field should be made
persistent (i.e. |
void |
storeMappingClass(MappingClassElement mappingClass)
Stores the supplied MappingClassElement to an xml file, creating the
file if necessary.
|
void |
storeMappingClass(MappingClassElement mappingClass,
OutputStream stream)
Stores the supplied MappingClassElement to an xml file in the
specified output stream.
|
void |
storeMappingClass(String className)
Stores the MappingClassElement for the specified class name to an xml
file, creating the file if necessary.
|
void |
unlockFile(OutputStream stream,
String className) |
void |
unlockFile(String className) |
void |
updateKeyForClass(MappingClassElement mappingClass,
String oldName)
Updates the key in the cache for the supplied MappingClassElement.
|
Collection |
validate(String className,
ClassLoader classLoader,
ResourceBundle bundle)
Validates the combination of java (or class) information and mapping/jdo
information by running through the full validation check and returning
a collection of ModelValidationExceptions containing any errors or
warnings encountered.
|
Collection |
validate(String className,
ResourceBundle bundle)
Validates the combination of java (or class) information and mapping/jdo
information by running through the full validation check and returning
a collection of ModelValidationExceptions containing any errors or
warnings encountered.
|
public static final Model RUNTIME
public static final Model ENHANCER
public static final String[] NO_ARGS
public static final String messageBase
protected static Model NewModel(String testName, String modelName)
modelName
- the fully qualified name of the class to be
instantiated.testName
- the fully qualified name of the class to be tested
as a precondition to loading.protected static final ResourceBundle getMessages()
protected abstract BufferedInputStream getInputStreamForResource(String className, ClassLoader classLoader, String resourceName)
className
- the fully qualified name of the class which will be
used as a base to find the resourceclassLoader
- the class loader used to find mapping informationresourceName
- the name of the resource to be foundnull
if an error occurs or none existspublic abstract boolean isInterface(String className)
className
- the fully qualified name of the class to be checkedtrue
if this class name represents an interface;
false
otherwise.public boolean hasPersistentSuperclass(String className)
className
- the fully qualified name of the class to be checkedtrue
if this class name represents a class which
has a persistent superclass (anywhere in the inheritance chain);
false
otherwise.protected abstract String findPenultimateSuperclass(String className)
className
- the fully qualified name of the class to be checkedclassName
if an error occurs or none existsprotected abstract String getSuperclass(String className)
className
- the fully qualified name of the class to be checkednull
if an error
occurs or none existspublic PersistenceClassElement getPersistenceClass(String className)
className
- the fully qualified name of the persistence capable
class to be returnednull
if an error occurs or none existsgetMappingClass(java.lang.String)
public PersistenceClassElement getPersistenceClass(String className, ClassLoader classLoader)
className
- the fully qualified name of the persistence capable
class to be returnedclassLoader
- the class loader used to find mapping informationnull
if an error occurs or none existsgetMappingClass(java.lang.String)
protected PersistenceClassElement getPersistenceClass(MappingClassElement mappingClass)
mappingClass
- the mapping class element to which the persistence
class is associatednull
if an error occurs or none existsgetMappingClass(java.lang.String)
public MappingClassElement getMappingClass(String className)
className
- the fully qualified name of the mapping classnull
if an error occurs or none existspublic MappingClassElement getMappingClass(String className, ClassLoader classLoader)
className
- the fully qualified name of the mapping classclassLoader
- the class loader used to find mapping informationnull
if an error occurs or none existsMappingClassElementImpl.forName(java.lang.String, com.sun.jdo.api.persistence.model.Model)
public Map getMappingCache()
public Map getClassLoaderCache()
public void removeResourcesFromCaches(ClassLoader classLoader)
classLoader
- used to determine the classes to be removedprotected void removeResourcesFromCaches(Collection classNames)
classNames
- a collection of fully qualified class namespublic void removeFromCache(String className)
className
- the fully qualified name of the classpublic void storeMappingClass(MappingClassElement mappingClass) throws IOException
mappingClass
- the mapping class to be savedIOException
- if there is some error saving the classcreateFile(java.lang.String, java.lang.String, java.lang.String)
public void storeMappingClass(MappingClassElement mappingClass, OutputStream stream) throws IOException
mappingClass
- the mapping class to be savedstream
- the output streamIOException
- if there is some error saving the classcreateFile(java.lang.String, java.lang.String, java.lang.String)
public void unlockFile(OutputStream stream, String className) throws IOException
IOException
public void lockFile(String className) throws IOException
IOException
public void unlockFile(String className)
public void storeMappingClass(String className) throws IOException
className
- the fully qualified name of the mapping classIOException
- if there is some error saving the classstoreMappingClass(com.sun.jdo.api.persistence.model.mapping.MappingClassElement)
public void updateKeyForClass(MappingClassElement mappingClass, String oldName)
mappingClass
- the mapping class to be put in the cache
(the new name is extracted from this element). The corresponding
handling of the files is automatically handled by the data object.
(use null
to remove the old key but not replace it)oldName
- the fully qualified name of the old key for the mapping
class (use null
to add the new key but not replace it)public boolean isPersistent(String className)
className
- the fully qualified name of the class to be checkedtrue
if this class name represents a persistence
capable class; false
otherwise.public boolean isPersistent(String className, ClassLoader classLoader)
className
- the fully qualified name of the class to be checkedclassLoader
- the class loader used to find mapping informationtrue
if this class name represents a persistence
capable class; false
otherwise.public boolean isPersistenceCapableAllowed(String className)
className
- the fully qualified name of the class to be checkedtrue
if this class name represents a legal
candidate for becoming a persistence capable class;
false
otherwise.getModifiersForClass(java.lang.String)
,
isInterface(java.lang.String)
,
findPenultimateSuperclass(java.lang.String)
protected String getResourceNameWithExtension(String className)
className
- the fully qualified name of the classMappingClassElement.MAPPING_EXTENSION
protected String getResourceName(String className)
className
- the fully qualified name of the classprotected String getFileNameWithExtension(String className)
className
- the fully qualified name of the classgetFileName(java.lang.String)
,
MappingClassElement.MAPPING_EXTENSION
protected String getFileName(String className)
className
- the fully qualified name of the classpublic void convertToPersistenceCapable(String className, boolean flag) throws IOException
className
- the fully qualified name of the classflag
- if true
, convert this class to be
persistence capable, if false
, convert this class
to be non-persistence capableIOException
- if there is some error converting the classpublic void convertToPersistenceCapable(String className) throws IOException
className
- the fully qualified name of the classIOException
- if there is some error storing the classpublic void convertDefaultFields(String className)
className
- the fully qualified name of the classcreateSkeletonMappingClass(java.lang.String)
,
convertFields(java.lang.String, java.util.List)
public void convertFields(String className, List fields)
className
- the fully qualified name of the classfields
- a list of (short) field namesconvertDefaultFields(java.lang.String)
public boolean addFieldElement(PersistenceClassElement element, String fieldName)
element
- the persistence class element to be usedfieldName
- the name of the field to be addedpublic void removeFieldElement(PersistenceFieldElement element) throws ModelException
element
- the persistence field element to be removedModelException
- if there is some error removing the fieldpublic String getRelatedClass(RelationshipElement element)
element
- the relationship element to be examinedpublic ArrayList getSupportedCollectionClasses(String className)
className
- the fully qualified name of the class to be checkedgetFieldType(java.lang.String, java.lang.String)
,
getDefaultCollectionClass(java.lang.String)
public String getDefaultCollectionClass(String className)
className
- the fully qualified name of the class to be checkedgetFieldType(java.lang.String, java.lang.String)
,
getSupportedCollectionClasses(java.lang.String)
protected abstract BufferedOutputStream createFile(String className, String baseFileName, String extension) throws IOException
className
- the fully qualified name of the classbaseFileName
- the name of the base fileextension
- the file extensionnull
if an error occurs or none existsIOException
- if there is some error creating the fileprotected abstract void deleteFile(String className, String fileName) throws IOException
className
- the fully qualified name of the classfileName
- the name of the fileIOException
- if there is some error deleting the filepublic abstract List getFields(String className)
className
- the fully qualified name of the class to be checkedpublic List getAllFields(String className)
className
- the fully qualified name of the class to be checkedpublic Object getClass(String className)
className
- the fully qualified name of the class to be checkedpublic abstract Object getClass(String className, ClassLoader classLoader)
className
- the fully qualified name of the class to be checkedclassLoader
- the class loader used to find mapping informationpublic boolean hasClass(String className)
className
- the fully qualified name of the class to be checkedtrue
if this class name represents a valid
class; false
otherwise.public boolean hasClass(String className, ClassLoader classLoader)
className
- the fully qualified name of the class to be checkedclassLoader
- the class loader used to find mapping informationtrue
if this class name represents a valid
class; false
otherwise.public abstract boolean implementsInterface(Object classElement, String interfaceName)
classElement
- the class element to be checkedinterfaceName
- the fully qualified name of the interface to
be checkedtrue
if the class implements the interface;
false
otherwise.getClass(java.lang.String)
public abstract boolean hasConstructor(String className)
className
- the name of the class to be checkedtrue
if the class declares a constructor;
false
otherwise.getClass(java.lang.String)
public abstract Object getConstructor(String className, String[] argTypeNames)
className
- the name of the class which contains the constructor
to be checkedargTypeNames
- the fully qualified names of the argument typesgetClass(java.lang.String)
public abstract Object getMethod(String className, String methodName, String[] argTypeNames)
className
- the name of the class which contains the method
to be checkedmethodName
- the name of the method to be checkedargTypeNames
- the fully qualified names of the argument typesgetClass(java.lang.String)
public Object getInheritedMethod(String className, String methodName, String[] argTypeNames)
className
- the name of the class which contains the method
to be checkedmethodName
- the name of the method to be checkedargTypeNames
- the fully qualified names of the argument typesgetClass(java.lang.String)
public abstract String getType(Object element)
element
- the element to be checkedgetField(java.lang.String, java.lang.String)
,
getMethod(java.lang.String, java.lang.String, java.lang.String[])
public abstract Object getField(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedpublic Object getInheritedField(String className, String fieldName)
className
- the fully qualified name of the class which contains
a superclass with the field to be checkedfieldName
- the name of the field to be checkedpublic boolean hasField(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedtrue
if this field name represents a valid
field; false
otherwise.public String getFieldType(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedpublic abstract boolean isSerializable(Object fieldElement)
fieldElement
- the field element to be checkedtrue
if the field element has a serializable type;
false
otherwise.getField(java.lang.String, java.lang.String)
public boolean isPrimitive(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedtrue
if this field name represents a primitive
field; false
otherwise.getFieldType(java.lang.String, java.lang.String)
protected boolean isPrimitive(String className)
className
- the fully qualified name of the class or type to be
checkedtrue
if this class represents a primitive;
false
otherwise.getFieldType(java.lang.String, java.lang.String)
public abstract boolean isArray(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedtrue
if this field name represents a java array
field; false
otherwise.getFieldType(java.lang.String, java.lang.String)
public boolean isByteArray(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedtrue
if this field name represents a byte array
field; false
otherwise.getFieldType(java.lang.String, java.lang.String)
protected boolean isByteArray(String className)
className
- the fully qualified name of the class or type to be
checkedtrue
if this class represents a byte array;
false
otherwise.public boolean isCollection(String className)
className
- the fully qualified name of the class to be checkedtrue
if this class represents a collection;
false
otherwise.getFieldType(java.lang.String, java.lang.String)
public boolean isSecondClassObject(String className)
className
- the fully qualified name of the class to be checkedtrue
if this class represents a second class
object; false
otherwise.isMutableSecondClassObject(java.lang.String)
,
isCollection(java.lang.String)
,
getFieldType(java.lang.String, java.lang.String)
public boolean isMutableSecondClassObject(String className)
className
- the fully qualified name of the class to be checkedtrue
if this class represents a mutable second
class object; false
otherwise.isSecondClassObject(java.lang.String)
,
isCollection(java.lang.String)
,
getFieldType(java.lang.String, java.lang.String)
public abstract String getDeclaringClass(Object memberElement)
memberElement
- the member element to be checkedgetClass(java.lang.String)
,
getField(java.lang.String, java.lang.String)
,
getConstructor(java.lang.String, java.lang.String[])
,
getMethod(java.lang.String, java.lang.String, java.lang.String[])
public abstract int getModifiers(Object memberElement)
memberElement
- the member element to be checkedModifier
,
getClass(java.lang.String)
,
getField(java.lang.String, java.lang.String)
,
getConstructor(java.lang.String, java.lang.String[])
,
getMethod(java.lang.String, java.lang.String, java.lang.String[])
public int getModifiersForClass(String className)
className
- the fully qualified name of the class to be checkedModifier
protected int getModifiers(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedModifier
public boolean isPersistentAllowed(String className, String fieldName)
true
if the specified field can be made
persistent, false
otherwise. This computation is based
on the modifier and type of the field. Fields which are non-final
and non-static and are primitive, persistence capable, or second
class objects and not arrays return true
.className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedgetModifiers(String,String)
,
isPrimitive(java.lang.String, java.lang.String)
,
isArray(java.lang.String, java.lang.String)
,
isPersistent(java.lang.String)
,
isSecondClassObject(java.lang.String)
,
shouldBePersistent(java.lang.String, java.lang.String)
public boolean isPersistentAllowed(String className, ClassLoader classLoader, String fieldName)
true
if the specified field can be made
persistent, false
otherwise. This computation is based
on the modifier and type of the field. Fields which are non-final
and non-static and are primitive, persistence capable, byte arrays, or
second class objects and not arrays return true
.className
- the fully qualified name of the class which contains
the field to be checkedclassLoader
- the class loader used to find mapping informationfieldName
- the name of the field to be checkedgetModifiers(String,String)
,
getFieldType(java.lang.String, java.lang.String)
,
isPersistentTypeAllowed(java.lang.String, java.lang.ClassLoader)
,
shouldBePersistent(java.lang.String, java.lang.String)
protected boolean isPersistentTypeAllowed(String className, ClassLoader classLoader)
true
if the a field of the specified class or
type can be made persistent, false
otherwise. Fields
which are primitive, persistence capable, byte arrays, or second
class objects and not arrays return true
.className
- the fully qualified name of the class or type to be
checkedclassLoader
- the class loader used to find mapping informationtrue
if this class represents a type which
can be made persistent; false
otherwise.isPrimitive(java.lang.String, java.lang.String)
,
isByteArray(java.lang.String, java.lang.String)
,
isPersistent(java.lang.String)
,
isSecondClassObject(java.lang.String)
public boolean shouldBePersistent(String className, String fieldName)
true
if the specified field should be made
persistent (i.e. does it make sense), false
otherwise.
This computation is based solely on the modifier: those which are not
volatile return true
.className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedpublic PersistenceFieldElement getPersistenceField(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkednull
if an error occurs or none existsprotected PersistenceFieldElement getPersistenceFieldInternal(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkednull
if an error occurs or none existspublic boolean isPersistent(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedtrue
if this field name represents a persistent
field; false
otherwise.public boolean isKey(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedtrue
if this field name represents a key field;
false
otherwise.public boolean isValidKeyType(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedtrue
if this field name represents a field
with a valid type for a key field; false
otherwise.public boolean isDefaultFetchGroup(String className, String fieldName)
className
- the fully qualified name of the class which contains
the field to be checkedfieldName
- the name of the field to be checkedtrue
if this field name represents a field in
the default fetch group; false
otherwise.public boolean parse(String className)
false
at the first error or
warning.className
- the fully qualified name of the class to be checkedtrue
if no errors or warnings occur,
false
otherwise.public Collection validate(String className, ResourceBundle bundle)
className
- the fully qualified name of the class to be checkedbundle
- the overridden resource bundle file - specify
null
if the default one should be usednull
.public Collection validate(String className, ClassLoader classLoader, ResourceBundle bundle)
className
- the fully qualified name of the class to be checkedclassLoader
- the class loader used to find mapping informationbundle
- the overridden resource bundle file - specify
null
if the default one should be usednull
.public static String[] getReadObjectArgs()
public static String[] getEqualsArgs()
public static String[] getWriteObjectArgs()
Copyright © 2020. All rights reserved.