|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.model.java.AbstractJavaModel
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 java.util.Set |
children
The child JavaModels. |
protected JDOModel |
jdoModel
The corresponding JDOModel instance. |
protected JavaModel |
parent
The parent JavaModel. |
protected java.util.Map |
types
Map of known JavaTypes. |
Constructor Summary | |
protected |
AbstractJavaModel()
Constructor. |
Method Summary | |
JavaModel[] |
getChildren()
Returns a collection of child JavaModel instances in the form of an array. |
abstract java.io.InputStream |
getInputStreamForResource(java.lang.String resourceName)
Finds a resource with a given name. |
JavaType |
getJavaType(java.lang.Class clazz)
The method returns the JavaType instance for the type name of the specified class object. |
abstract JavaType |
getJavaType(java.lang.String name)
The method returns the JavaType instance for the specified type name. |
JDOModel |
getJDOModel()
Returns the corresponding JDOModel instance. |
JavaModel |
getParent()
Returns the parent JavaModel instance of this JavaModel. |
void |
setJDOModel(JDOModel jdoModel)
Sets the corresponding JDOModel instance. |
void |
setParent(JavaModel parent)
Set the parent JavaModel for this JavaModel. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Map types
protected JavaModel parent
protected java.util.Set children
protected JDOModel jdoModel
Constructor Detail |
protected AbstractJavaModel()
PredefinedType
Method Detail |
public abstract JavaType getJavaType(java.lang.String name)
null
if this model instance does not
know a type with the specified name.
getJavaType
in interface JavaModel
name
- the name of the type
null
if not present in this model instance.public JavaType getJavaType(java.lang.Class clazz)
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.
- Specified by:
getJavaType
in interface JavaModel
- Parameters:
clazz
- the Class instance representing the type
- Returns:
- a JavaType instance for the name of the specified class
object.
public abstract java.io.InputStream getInputStreamForResource(java.lang.String resourceName)
null
if no resource with this name is found or if the
caller doesn't have adequate privileges to get the resource.
getInputStreamForResource
in interface JavaModel
resourceName
- the resource name
null
if the resource could not be found or if the caller doesn't have
adequate privileges to get the resource.public JavaModel getParent()
getParent
in interface JavaModel
public void setParent(JavaModel parent) throws ModelException
setParent
in interface JavaModel
parent
- the parent JavaModel
ModelException
- if impossiblepublic JavaModel[] getChildren()
getChildren
in interface JavaModel
public JDOModel getJDOModel()
getJDOModel
in interface JavaModel
public void setJDOModel(JDOModel jdoModel) throws ModelException
setJDOModel
in interface JavaModel
jdoModel
- the JDOModel instance
ModelException
- if impossible
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |