|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.api.persistence.model.Model
com.sun.jdo.api.persistence.model.RuntimeModel
com.sun.jdo.spi.persistence.support.ejb.model.DeploymentDescriptorModel
public class DeploymentDescriptorModel
This is a subclass of RuntimeModel which uses the deployment descriptor to augment the java metadata for a non-existent persistence-capable java/class file. It is primarily used at ejbc time, though it could be used at any time as long as sufficient mapping and deployment descriptor information is available. See the javadoc for individual methods below for differences and translations between persistence-capable and ejb names and behavior. There are different answers to methods depending on whether they are called on the persistence-capable or the ejb. These are primarily for the handling of serializable, non-primitive, non-wrapper type fields: isByteArray, getFieldType (returning byte array), isPersistentTypeAllowed and isPersistentAllowed (returning true) which return answers about the byte array when called on the persistence-capable and return answers about the serializable type when called on the ejb.
| Field Summary | |
|---|---|
static String |
SIGNATURE
Signature with CVS keyword substitution for identifying the generated code |
| Fields inherited from class com.sun.jdo.api.persistence.model.Model |
|---|
ENHANCER, messageBase, NO_ARGS, RUNTIME |
| Constructor Summary | |
|---|---|
DeploymentDescriptorModel(NameMapper nameMapper,
ClassLoader classLoader)
Creates a new instance of DeploymentDescriptorModel |
|
| Method Summary | |
|---|---|
protected 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 void |
deleteFile(String className,
String fileName)
Deletes the file with the given file name which is parallel to the supplied class. |
protected ClassLoader |
findClassLoader(String className,
ClassLoader classLoader)
This method returns the class loader used to find mapping information for the specified className. |
protected 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,
ClassLoader classLoader)
Returns the class element with the specified className. |
Object |
getConstructor(String className,
String[] argTypeNames)
Returns a wrapped constructor element for the specified argument types in the class with the specified name. |
String |
getDeclaringClass(Object memberElement)
Returns the string representation of declaring class of the specified member element. |
Object |
getField(String className,
String fieldName)
Returns a wrapped field element for the specified fieldName in the class with the specified className. |
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. |
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 BufferedInputStream |
getInputStreamForResource(String className,
ClassLoader classLoader,
String resourceName)
Returns the input stream with the supplied resource name found with the supplied class name. |
Object |
getMethod(String className,
String methodName,
String[] argTypeNames)
Returns a wrapped method element for the specified method name and argument types in the class with the specified name. |
int |
getModifiers(Object memberElement)
Returns the modifier mask for the specified member element. |
int |
getModifiersForClass(String className)
Returns the modifier mask for the specified className. |
protected String |
getSuperclass(String className)
Returns the name of the superclass for the given class name. |
protected Class |
getTypeObject(Object element)
Returns the Class type of the specified element. |
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. |
| Methods inherited from class com.sun.jdo.api.persistence.model.RuntimeModel |
|---|
getClassLoaderCache, getFile, getMappingClass, getType, hasConstructor, implementsInterface, isArray, isInterface, isSerializable, removeResourcesFromCaches |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SIGNATURE
| Constructor Detail |
|---|
public DeploymentDescriptorModel(NameMapper nameMapper,
ClassLoader classLoader)
nameMapper - the name mapper to be used as a helper for
translation between persistence class and ejb names.classLoader - the class loader object which is used for the
application.| Method Detail |
|---|
protected BufferedInputStream getInputStreamForResource(String className,
ClassLoader classLoader,
String resourceName)
getInputStreamForResource in class RuntimeModelclassName - 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 information
This parameter is ignored in this implementation - instead the
class loader supplied at construction time is used.resourceName - the name of the resource to be found
null
if an error occurs or none existsprotected String findPenultimateSuperclass(String className)
findPenultimateSuperclass in class RuntimeModelclassName - the fully qualified name of the class to be checked
className if an error occurs or none existsprotected String getSuperclass(String className)
getSuperclass in class RuntimeModelclassName - the fully qualified name of the class to be checked
null if an error
occurs or none exists
protected BufferedOutputStream createFile(String className,
String baseFileName,
String extension)
throws IOException
createFile in class RuntimeModelclassName - the fully qualified name of the classbaseFileName - the name of the base fileextension - the file extension
null
if an error occurs or none exists
IOException - if there is some error creating the file
protected void deleteFile(String className,
String fileName)
throws IOException
deleteFile in class RuntimeModelclassName - the fully qualified name of the classfileName - the name of the file
IOException - if there is some error deleting the file
public Object getClass(String className,
ClassLoader classLoader)
getClass in class RuntimeModelclassName - the fully qualified name of the class to be checkedclassLoader - the class loader used to find mapping information
public Object getConstructor(String className,
String[] argTypeNames)
getConstructor in class RuntimeModelclassName - the name of the class which contains the constructor
to be checkedargTypeNames - the fully qualified names of the argument types
getClass(java.lang.String, java.lang.ClassLoader)
public Object getMethod(String className,
String methodName,
String[] argTypeNames)
getMethod in class RuntimeModelclassName - 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 types
getClass(java.lang.String, java.lang.ClassLoader)
public Object getInheritedMethod(String className,
String methodName,
String[] argTypeNames)
getInheritedMethod in class ModelclassName - 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 types
getClass(java.lang.String, java.lang.ClassLoader)public List getFields(String className)
getFields in class RuntimeModelclassName - the fully qualified name of the class to be checked
public List getAllFields(String className)
getAllFields in class ModelclassName - the fully qualified name of the class to be checked
public Object getField(String className,
String fieldName)
getField in class RuntimeModelclassName - the fully qualified name of the class which contains
the field to be checkedfieldName - the name of the field to be checked
public String getFieldType(String className,
String fieldName)
getFieldType in class ModelclassName - the fully qualified name of the class which contains
the field to be checkedfieldName - the name of the field to be checked
public String getDeclaringClass(Object memberElement)
getDeclaringClass in class RuntimeModelmemberElement - the member element to be checked
getClass(java.lang.String, java.lang.ClassLoader),
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 getModifiers(Object memberElement)
getModifiers in class RuntimeModelmemberElement - the member element to be checked
Modifier,
getClass(java.lang.String, java.lang.ClassLoader),
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)
getModifiersForClass in class ModelclassName - the fully qualified name of the class to be checked
Modifier
public boolean isValidKeyType(String className,
String fieldName)
isValidKeyType in class ModelclassName - the fully qualified name of the class which contains
the field to be checkedfieldName - the name of the field to be checked
true if this field name represents a field
with a valid type for a key field; false otherwise.protected Class getTypeObject(Object element)
getTypeObject in class RuntimeModelelement - the element to be checked
getField(java.lang.String, java.lang.String),
RuntimeModel.getMethod(java.lang.String, java.lang.String, java.lang.String[])
protected ClassLoader findClassLoader(String className,
ClassLoader classLoader)
findClassLoader in class RuntimeModelclassName - the fully qualified name of the class to be checkedclassLoader - the class loader used to find mapping information
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||