|
||||||||||
| 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
public class RuntimeModel
| Field Summary |
|---|
| Fields inherited from class com.sun.jdo.api.persistence.model.Model |
|---|
ENHANCER, messageBase, NO_ARGS, RUNTIME |
| Constructor Summary | |
|---|---|
protected |
RuntimeModel()
Creates a new RuntimeModel. |
| 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. |
Object |
getClass(String className,
ClassLoader classLoader)
Returns the class element with the specified className. |
Map |
getClassLoaderCache()
Returns an unmodifiable copy of the ClassLoader cache. |
Object |
getConstructor(String className,
String[] argTypeNames)
Returns the 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 the 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. |
protected File |
getFile(String className,
String fileName)
Returns a file with the given file name which is parallel to the supplied class. |
protected BufferedInputStream |
getInputStreamForResource(String className,
ClassLoader classLoader,
String resourceName)
Returns the input stream with the supplied resource name found with the supplied class name. |
MappingClassElement |
getMappingClass(String className,
ClassLoader classLoader)
Returns the MappingClassElement created for the specified class name. |
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. |
int |
getModifiers(Object memberElement)
Returns the modifier mask for the specified member element. |
protected String |
getSuperclass(String className)
Returns the name of the superclass for the given class name. |
String |
getType(Object element)
Returns the string representation of type of the specified element. |
protected Class |
getTypeObject(Object element)
Returns the Class type of the specified element. |
boolean |
hasConstructor(String className)
Determines if the class with the specified name declares a constructor. |
boolean |
implementsInterface(Object classElement,
String interfaceName)
Determines if the specified class implements the specified interface. |
boolean |
isArray(String className,
String fieldName)
Determines if a field with the specified fieldName in the class with the specified className is an array. |
boolean |
isInterface(String className)
Determines if the specified className represents an interface type. |
boolean |
isSerializable(Object fieldElement)
Determines if the specified field element has a serializable type. |
void |
removeResourcesFromCaches(ClassLoader classLoader)
Removes the classes cached with the specified class loader from all caches. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected RuntimeModel()
Model.RUNTIME| Method Detail |
|---|
public boolean isInterface(String className)
isInterface in class ModelclassName - the fully qualified name of the class to be checked
true if this class name represents an interface;
false otherwise.
protected BufferedInputStream getInputStreamForResource(String className,
ClassLoader classLoader,
String resourceName)
getInputStreamForResource in class ModelclassName - 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 found
null
if an error occurs or none existsprotected String findPenultimateSuperclass(String className)
findPenultimateSuperclass in class ModelclassName - 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 ModelclassName - the fully qualified name of the class to be checked
null if an error
occurs or none exists
public MappingClassElement getMappingClass(String className,
ClassLoader classLoader)
getMappingClass in class ModelclassName - the fully qualified name of the mapping classclassLoader - the class loader used to find mapping information
null if an error occurs or none existsMappingClassElementImpl.forName(String, Model)public Map getClassLoaderCache()
getClassLoaderCache in class Modelpublic void removeResourcesFromCaches(ClassLoader classLoader)
removeResourcesFromCaches in class ModelclassLoader - used to determine the classes to be removed
protected BufferedOutputStream createFile(String className,
String baseFileName,
String extension)
throws IOException
createFile in class ModelclassName - 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 ModelclassName - the fully qualified name of the classfileName - the name of the file
IOException - if there is some error deleting the file
protected File getFile(String className,
String fileName)
throws IOException
className - the fully qualified name of the classfileName - the name of the file
null
if an error occurs
IOException - if there is some error getting the file
public Object getClass(String className,
ClassLoader classLoader)
Class.forName.
getClass in class ModelclassName - the fully qualified name of the class to be checkedclassLoader - the class loader used to find mapping information
null
if an error occurs or none exists
protected ClassLoader findClassLoader(String className,
ClassLoader classLoader)
throws IllegalArgumentException
className - the fully qualified name of the class to be checkedclassLoader - the class loader used to find mapping information
IllegalArgumentException - if there is class loader problem
public boolean implementsInterface(Object classElement,
String interfaceName)
implementsInterface in class ModelclassElement - the class element to be checkedinterfaceName - the fully qualified name of the interface to
be checked
true if the class implements the interface;
false otherwise.getClass(java.lang.String, java.lang.ClassLoader)public boolean hasConstructor(String className)
hasConstructor in class ModelclassName - the name of the class to be checked
true if the class declares a constructor;
false otherwise.getClass(java.lang.String, java.lang.ClassLoader)
public Object getConstructor(String className,
String[] argTypeNames)
getConstructor in class ModelclassName - 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 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 String getType(Object element)
getType in class Modelelement - the element to be checked
getField(java.lang.String, java.lang.String),
getMethod(java.lang.String, java.lang.String, java.lang.String[])public List getFields(String className)
getFields in class ModelclassName - the fully qualified name of the class to be checked
public Object getField(String className,
String fieldName)
getField 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 boolean isSerializable(Object fieldElement)
isSerializable in class ModelfieldElement - the field element to be checked
true if the field element has a serializable type;
false otherwise.getField(java.lang.String, java.lang.String)
public boolean isArray(String className,
String fieldName)
isArray 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 java array
field; false otherwise.Model.getFieldType(java.lang.String, java.lang.String)public String getDeclaringClass(Object memberElement)
getDeclaringClass in class ModelmemberElement - 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 ModelmemberElement - 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[])protected Class getTypeObject(Object element)
element - the element to be checked
getField(java.lang.String, java.lang.String),
getMethod(java.lang.String, java.lang.String, java.lang.String[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||