FileDocCategorySizeDatePackage
EnhancerModel.javaAPI DocGlassfish v2 API14014Fri May 04 22:34:42 BST 2007com.sun.jdo.api.persistence.model

EnhancerModel

public class EnhancerModel extends Model
author
nico
version
%I%

Fields Summary
private static final boolean
DEBUG
Constructors Summary
EnhancerModel()
Creates a new EnhancerModel. This constructor should not be called directly; instead, the static instance accessible from the Model class should be used.

see
Model#ENHANCER


	                          	 
	  
		super();
	
Methods Summary
protected java.io.BufferedOutputStreamcreateFile(java.lang.String className, java.lang.String baseFileName, java.lang.String extension)
Creates a file with the given base file name and extension parallel to the supplied class (if it does not yet exist).

param
className the fully qualified name of the class
param
baseFileName the name of the base file
param
extension the file extension
return
the output stream for the specified resource, null if an error occurs or none exists
exception
IOException if there is some error creating the file

		throw new UnsupportedOperationException();
	
private voiddebug(java.lang.Object o)

		if (DEBUG)
			System.out.println("EnhancerModel::" + o);	// NOI18N
	
protected voiddeleteFile(java.lang.String className, java.lang.String fileName)
Deletes the file with the given file name which is parallel to the supplied class.

param
className the fully qualified name of the class
param
fileName the name of the file
exception
IOException if there is some error deleting the file

		throw new UnsupportedOperationException();
	
protected java.lang.StringfindPenultimateSuperclass(java.lang.String className)
Returns the name of the second to top (top excluding java.lang.Object) superclass for the given class name.

param
className the fully qualified name of the class to be checked
return
the top non-Object superclass for className, className if an error occurs or none exists

		debug("findPenultimateSuperclass(" + className + ")");	// NOI18N
		throw new UnsupportedOperationException();
	
public java.lang.ObjectgetClass(java.lang.String className, java.lang.ClassLoader classLoader)
Returns the class element with the specified className.

param
className the fully qualified name of the class to be checked
param
classLoader the class loader used to check the class
return
the class element for the specified className

		throw new UnsupportedOperationException();
	
public java.lang.ObjectgetConstructor(java.lang.String className, java.lang.String[] argTypeNames)
Returns the constructor element for the specified argument types in the class with the specified name. Types are specified as type names for primitive type such as int, float or as fully qualified class names.

param
className the name of the class which contains the constructor to be checked
param
argTypeNames the fully qualified names of the argument types
return
the constructor element
see
#getClass

		throw new UnsupportedOperationException();
	
public java.lang.StringgetDeclaringClass(java.lang.Object memberElement)
Returns the string representation of declaring class of the specified member element. Note, the member element is either a class element as returned by getClass, a field element as returned by getField, a constructor element as returned by getConstructor, or a method element as returned by getMethod executed on the same model instance.

param
memberElement the member element to be checked
return
the string representation of the declaring class of the specified memberElement
see
#getClass
see
#getField
see
#getConstructor
see
#getMethod

		throw new UnsupportedOperationException();
	
public java.lang.ObjectgetField(java.lang.String className, java.lang.String fieldName)
Returns the field element for the specified fieldName in the class with the specified className.

param
className the fully qualified name of the class which contains the field to be checked
param
fieldName the name of the field to be checked
return
the field element for the specified fieldName

		throw new UnsupportedOperationException();
	
public java.util.ListgetFields(java.lang.String className)
Returns a list of names of all the declared field elements in the class with the specified name.

param
className the fully qualified name of the class to be checked
return
the names of the field elements for the specified class

		throw new UnsupportedOperationException();
	
protected java.io.BufferedInputStreamgetInputStreamForResource(java.lang.String className, java.lang.ClassLoader classLoader, java.lang.String resourceName)
Returns the input stream with the supplied resource name found with the supplied class name.

param
className the fully qualified name of the class which will be used as a base to find the resource
param
classLoader the class loader used to find the resource
param
resourceName the name of the resource to be found
return
the input stream for the specified resource, null if an error occurs or none exists

		debug("getInputStreamForResource(" + className + 	// NOI18N
			"," + resourceName + ")");						// NOI18N

        InputStream is = (classLoader != null)
			? classLoader.getResourceAsStream(resourceName)
            : ClassLoader.getSystemResourceAsStream(resourceName);

        BufferedInputStream rc = null;
        if (is != null && !(is instanceof BufferedInputStream)) {
            rc = new BufferedInputStream(is);
        } else {
            rc = (BufferedInputStream)is;
        }
        return rc;
	
public java.lang.ObjectgetMethod(java.lang.String className, java.lang.String methodName, java.lang.String[] argTypeNames)
Returns the method element for the specified method name and argument types in the class with the specified name. Types are specified as type names for primitive type such as int, float or as fully qualified class names.

param
className the name of the class which contains the method to be checked
param
methodName the name of the method to be checked
param
argTypeNames the fully qualified names of the argument types
return
the method element
see
#getClass

		throw new UnsupportedOperationException();
	
public intgetModifiers(java.lang.Object memberElement)
Returns the modifier mask for the specified member element. Note, the member element is either a class element as returned by getClass, a field element as returned by getField, a constructor element as returned by getConstructor, or a method element as returned by getMethod executed on the same model instance.

param
memberElement the member element to be checked
return
the modifier mask for the specified memberElement
see
java.lang.reflect.Modifier
see
#getClass
see
#getField
see
#getConstructor
see
#getMethod

		throw new UnsupportedOperationException();
	
public com.sun.jdo.api.persistence.model.jdo.PersistenceFieldElementgetPersistenceField(java.lang.String className, java.lang.String fieldName)
Returns the PersistenceFieldElement with the supplied fieldName found in the supplied className.

param
className the fully qualified name of the class which contains the field to be checked
param
fieldName the name of the field to be checked
return
the PersistenceFieldElement for the specified field, null if an error occurs or none exists

		return getPersistenceFieldInternal(className, fieldName);
	
protected java.lang.StringgetSuperclass(java.lang.String className)
Returns the name of the superclass for the given class name.

param
className the fully qualified name of the class to be checked
return
the superclass for className, null if an error occurs or none exists

		debug("getSuperclass (" + className + ")");	// NOI18N
		return null;	// "java.lang.Object";		// NOI18N
	
public java.lang.StringgetType(java.lang.Object element)
Returns the string representation of type of the specified element. If element denotes a field, it returns the type of the field. If element denotes a method, it returns the return type of the method. Note, element is either a field element as returned by getField, or a method element as returned by getMethod executed on the same model instance.

param
element the element to be checked
return
the string representation of the type of the element
see
#getField
see
#getMethod

		throw new UnsupportedOperationException();
	
public booleanhasConstructor(java.lang.String className)
Determines if the class with the specified name declares a constructor.

param
className the name of the class to be checked
return
true if the class declares a constructor; false otherwise.
see
#getClass

		throw new UnsupportedOperationException();
	
public booleanimplementsInterface(java.lang.Object classElement, java.lang.String interfaceName)
Determines if the specified class implements the specified interface. Note, class element is a model specific class representation as returned by a getClass call executed on the same model instance.

param
classElement the class element to be checked
param
interfaceName the fully qualified name of the interface to be checked
return
true if the class implements the interface; false otherwise.
see
#getClass

		throw new UnsupportedOperationException();
	
public booleanisArray(java.lang.String className, java.lang.String fieldName)
Determines if a field with the specified fieldName in the class with the specified className is an array.

param
className the fully qualified name of the class which contains the field to be checked
param
fieldName the name of the field to be checked
return
true if this field name represents a java array field; false otherwise.
see
#getFieldType

		throw new UnsupportedOperationException();
	
public booleanisInterface(java.lang.String className)
Determines if the specified className represents an interface type.

param
className the fully qualified name of the class to be checked
return
true if this class name represents an interface; false otherwise.

		throw new UnsupportedOperationException();
	
public booleanisKey(java.lang.String className, java.lang.String fieldName)
Determines if the specified className and fieldName pair represent a key field.

param
className the fully qualified name of the class which contains the field to be checked
param
fieldName the name of the field to be checked
return
true if this field name represents a key field; false otherwise.

		PersistenceFieldElement field =
			getPersistenceField(className, fieldName);

		return field != null ? field.isKey() : false;
	
public booleanisSerializable(java.lang.Object fieldElement)
Determines if the specified field element has a serializable type. A type is serializable if it is a primitive type, a class that implements java.io.Serializable or an interface that inherits from java.io.Serializable. Note, the field element is a model specific field representation as returned by a getField call executed on the same model instance.

param
fieldElement the field element to be checked
return
true if the field element has a serializable type; false otherwise.
see
#getField

		throw new UnsupportedOperationException();