public abstract class AbstractJavaModel extends java.lang.Object implements JavaModel
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)
.
Modifier and Type | Field and Description |
---|---|
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.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractJavaModel()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected java.util.Map types
protected JavaModel parent
protected java.util.Set children
protected JDOModel jdoModel
protected AbstractJavaModel()
PredefinedType
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 typenull
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.
getJavaType
in interface JavaModel
clazz
- the Class instance representing the typepublic 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 namenull
if the resource could not be found or if the caller doesn't have
adequate privileges to get the resource.public JavaModel getParent()
public void setParent(JavaModel parent) throws ModelException
setParent
in interface JavaModel
parent
- the parent JavaModelModelException
- 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 instanceModelException
- if impossibleCopyright © 2005-2012 Apache Software Foundation. All Rights Reserved.