public class RuntimeModel extends Model
ENHANCER, messageBase, NO_ARGS, RUNTIME| Modifier | Constructor and Description |
|---|---|
protected |
RuntimeModel()
Creates a new RuntimeModel.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addFieldElement, convertDefaultFields, convertFields, convertToPersistenceCapable, convertToPersistenceCapable, getAllFields, getClass, getDefaultCollectionClass, getEqualsArgs, getFieldType, getFileName, getFileNameWithExtension, getInheritedField, getInheritedMethod, getMappingCache, getMappingClass, getMessages, getModifiers, getModifiersForClass, getPersistenceClass, getPersistenceClass, getPersistenceClass, getPersistenceField, getPersistenceFieldInternal, getReadObjectArgs, getRelatedClass, getResourceName, getResourceNameWithExtension, getSupportedCollectionClasses, getWriteObjectArgs, hasClass, hasClass, hasField, hasPersistentSuperclass, isByteArray, isByteArray, isCollection, isDefaultFetchGroup, isKey, isMutableSecondClassObject, isPersistenceCapableAllowed, isPersistent, isPersistent, isPersistent, isPersistentAllowed, isPersistentAllowed, isPersistentTypeAllowed, isPrimitive, isPrimitive, isSecondClassObject, isValidKeyType, lockFile, NewModel, parse, removeFieldElement, removeFromCache, removeResourcesFromCaches, shouldBePersistent, storeMappingClass, storeMappingClass, storeMappingClass, unlockFile, unlockFile, updateKeyForClass, validate, validateprotected RuntimeModel()
Model.RUNTIMEpublic boolean isInterface(String className)
isInterface in class ModelclassName - the fully qualified name of the class to be checkedtrue 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 foundnull
if an error occurs or none existsprotected String findPenultimateSuperclass(String className)
findPenultimateSuperclass in class ModelclassName - the fully qualified name of the class to be checkedclassName if an error occurs or none existsprotected String getSuperclass(String className)
getSuperclass in class ModelclassName - the fully qualified name of the class to be checkednull if an error
occurs or none existspublic 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 informationnull 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 removedprotected 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 extensionnull
if an error occurs or none existsIOException - if there is some error creating the fileprotected void deleteFile(String className, String fileName) throws IOException
deleteFile in class ModelclassName - the fully qualified name of the classfileName - the name of the fileIOException - if there is some error deleting the fileprotected File getFile(String className, String fileName) throws IOException
className - the fully qualified name of the classfileName - the name of the filenull
if an error occursIOException - if there is some error getting the filepublic Object getClass(String className, ClassLoader classLoader)
Class.forName.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 informationIllegalArgumentException - if there is class loader problempublic 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 checkedtrue 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 checkedtrue 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 typesgetClass(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 typesgetClass(java.lang.String, java.lang.ClassLoader)public String getType(Object element)
getType in class Modelelement - the element to be checkedgetField(java.lang.String, java.lang.String),
getMethod(java.lang.String, java.lang.String, java.lang.String[])public List getFields(String className)
public Object getField(String className, String fieldName)
public boolean isSerializable(Object fieldElement)
isSerializable in class ModelfieldElement - 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 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 checkedtrue 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 checkedgetClass(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 checkedModifier,
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 checkedgetField(java.lang.String, java.lang.String),
getMethod(java.lang.String, java.lang.String, java.lang.String[])Copyright © 2015. All rights reserved.