public interface JavaModelFactory
Modifier and Type | Method and Description |
---|---|
JavaModel |
createJavaModel(java.lang.Object key)
Creates a new empty JavaModel instance.
|
JavaModel |
getJavaModel(java.lang.Object key)
Returns the JavaModel instance for the specified key.
|
JavaType |
getJavaType(java.lang.Object typeDesc)
Returns a JavaType instance for the specified type description
(optional operation).
|
void |
removeJavaModel(JavaModel javaModel)
Removes the specified javaModel from the JavaModel cache.
|
void |
removeJavaModel(java.lang.Object key)
Removes the JavaModel for the specified key from the JavaModel
cache.
|
JavaModel createJavaModel(java.lang.Object key) throws ModelException
Each JavaModelFactory imposes its own restrictions for the keys to
cache JavaModel instances. Some implementations will allow only keys
of a certain type. Some implementations will prohibit
null
keys. Attempting to use an ineligible key will
result in a ModelException
. This means
the specified key is of an inappropriate type for this
JavaModelFactory or if the key is null
and this
JavaModelFactory does not support null
keys.
key
- the key that may be used to cache the returned JavaModel
instance.ModelException
- if impossible; the key is of an
inappropriate type or the key is null
and this
JavaModelFactory does not support null
keys.JavaModel getJavaModel(java.lang.Object key) throws ModelFatalException
The method throws a ModelFatalException
,
if the specified key is of an inappropriate type for this
JavaModelFactory or if the key is null
and this
JavaModelFactory does not support null
keys.
key
- the key used to cache the returned JavaModel instance.ModelFatalException
- the key is of an inappropriate type
or the key is null
and this JavaModelFactory does not
support null
keys.void removeJavaModel(JavaModel javaModel) throws ModelException
javaModel
- the JavaModel to be removed.ModelException
void removeJavaModel(java.lang.Object key) throws ModelException
key
- the key used to find the JavaModel instance to be removed.ModelException
JavaType getJavaType(java.lang.Object typeDesc) throws ModelFatalException
getJavaModel(key).getJavaType(typeName)
.
If the factory supports this method, it needs to be able to get the
key for the JavaModel lookup and the type name for the JavaType
lookup from the specified typeDesc. An example for such an type
description is the java.lang.Class instance in the runtime
environment.
The method throws a ModelFatalException
,
if this factory does not support this short cut or if it does not
support the specified type description.
typeDesc
- the type description.ModelFatalException
- this factory does not support this
short cut or does not support the specified type description.Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.