Save This Page
Home » jdo2-model-2.3-ea-src » » [javadoc | source]
abstract public class: AbstractJavaModel [javadoc | source]

All Implemented Interfaces:

Direct Known Subclasses:

Abstract super class for JavaModel implementations. It implements the jdoModel property and the parent/child relationship between javaModels. It also provides a map of types managed by this JavaModel (see #types ). The AbstractJavaModel constructor automatically adds all the predefined types to this map.

A non-abstract subclass must implement methods #getJavaType(String name) and #getInputStreamForResource(String resourceName) .

Field Summary
protected  Map types    Map of known JavaTypes. Key is the type name as a string. 
protected  JavaModel parent    The parent JavaModel. 
protected  Set children    The child JavaModels. 
protected  JDOModel jdoModel    The corresponding JDOModel instance. 
 protected AbstractJavaModel() 
Method from Summary:
getChildren,   getInputStreamForResource,   getJDOModel,   getJavaType,   getJavaType,   getParent,   setJDOModel,   setParent
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from Detail:
 public JavaModel[] getChildren() 
    Returns a collection of child JavaModel instances in the form of an array. All instances from the returned array have this JavaModel instance as parent.
 abstract public InputStream getInputStreamForResource(String resourceName)
    Finds a resource with a given name. A resource is some data that can be accessed by class code in a way that is independent of the location of the code. The name of a resource is a "/"-separated path name that identifies the resource. The method method opens the resource for reading and returns an InputStream. It returns null if no resource with this name is found or if the caller doesn't have adequate privileges to get the resource.
 public JDOModel getJDOModel() 
    Returns the corresponding JDOModel instance.
 abstract public JavaType getJavaType(String name)
    The method returns the JavaType instance for the specified type name. A type name is unique within one JavaModel instance. The method returns null if this model instance does not know a type with the specified name.
 public JavaType getJavaType(Class clazz) 
    The method returns the JavaType instance for the type name of the specified class object. This is a convenience method for getJavaType(clazz.getName()). The major difference between this method and getJavaType taking a type name is that this method is supposed to return a non-null value. The specified class object describes an existing type.
 public JavaModel getParent() 
    Returns the parent JavaModel instance of this JavaModel.
 public  void setJDOModel(JDOModel jdoModel) throws ModelException 
    Sets the corresponding JDOModel instance.
 public  void setParent(JavaModel parent) throws ModelException 
    Set the parent JavaModel for this JavaModel. The method automatically adds this JavaModel to the collection of children of the specified parent JavaModel.