public final class MetafacadeCache extends Object implements Serializable
MetafacadeFactory
when constructing or retrieving metafacade
instances. If the cache constains the metafacade it should not be constructed again.Modifier and Type | Method and Description |
---|---|
void |
add(Object mappingObject,
MetafacadeBase metafacade)
Adds the
metafacade to the cache according to first mappingObject , second the
metafacade , and finally by the current namespace . |
void |
clear()
Clears the cache of any metafacades
|
MetafacadeBase |
get(Object mappingObject,
Class metafacadeClass)
Returns the metafacade from the metafacade cache.
|
static MetafacadeCache |
newInstance()
Constructs a new instance of this class.
|
void |
setNamespace(String namespace)
Sets the namespace to which the cache currently applies.
|
String |
toString() |
public static MetafacadeCache newInstance()
public final void setNamespace(String namespace)
namespace
- the current namespace.public final MetafacadeBase get(Object mappingObject, Class metafacadeClass)
Returns the metafacade from the metafacade cache. The Metafacades are cached first by according to its
mappingObject
, next the metafacadeClass
, and finally by the current namespace.
Metafacades must be cached in order to keep track of the state of its validation. If we keep creating a new one each time, we can never tell whether or not a metafacade has been previously validated. Not to mention tremendous performance gains.
mappingObject
- the object to which the mapping appliesmetafacadeClass
- the class of the metafacade.public final void add(Object mappingObject, MetafacadeBase metafacade)
metafacade
to the cache according to first mappingObject
, second the
metafacade
, and finally by the current namespace
.mappingObject
- the mappingObject for which to cache the metafacade.metafacade
- the metafacade to cache.public final void clear()
public String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2014 AndroMDA.org. All rights reserved.