|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.model.mapper.Mapper
public final class Mapper
Mapper is a gate between model and persistence system. It provides mechanisms for saving and loading model objects without any direct DB interactions.
The idea of mapper is build on the presumption that any part of the model may be represented as a network of linked nodes. So
and
,
are primitives of the metamodel. Any model element is mapped to
network of nodes. This is done through annotation mechanism
,
Field Summary | |
---|---|
static String |
DEFAULT_FOLDER
The default name of the directory where models are stored. |
static String |
DEFAULT_PATH
The dafault path to the directory where models should be stored. |
static String |
DEFAULT_ROOT
The default root directory where models should be stored. |
Method Summary | |
---|---|
void |
clearCache()
Clear the object cache. |
void |
clearCache(boolean subLevel)
Clear the object cache. |
void |
finalize()
Close DB connection on exit. |
List |
find(Class klass,
Map<String,Class> typeMap,
SortedMap<String,Object> conditions,
org.eclipse.core.resources.IProject project)
Find objects mapped to the metamodel. |
static Mapper |
getInstance()
The only instance of the metamodel. |
static boolean |
isDBPresent()
Indicated if the Mapper was properly initialized (i.e. |
boolean |
remove(Mappable object,
org.eclipse.core.resources.IProject project)
Removes object from project. |
boolean |
save(Mappable object,
boolean force,
org.eclipse.core.resources.IProject project)
Saves objects mapped to metamodel. |
boolean |
save(Mappable object,
org.eclipse.core.resources.IProject project)
Saves objects mapped to metamodel. |
void |
stats()
Prints statistics of the mapper cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_ROOT
public static final String DEFAULT_FOLDER
public static final String DEFAULT_PATH
Method Detail |
---|
public static boolean isDBPresent()
public static Mapper getInstance()
public boolean save(Mappable object, org.eclipse.core.resources.IProject project)
object
- The object to be savedproject
- The project which the object belongs to. If null, the object is stored in the default location (useful
for testing).
public boolean save(Mappable object, boolean force, org.eclipse.core.resources.IProject project)
object
- The object to be savedforce
- If true, the object is saved even if its 'saved' flag is set to true.project
- The project which the object belongs to. If null, the object is stored in the default location (useful
for testing).
public void finalize()
finalize
in class Object
public List find(Class klass, Map<String,Class> typeMap, SortedMap<String,Object> conditions, org.eclipse.core.resources.IProject project)
klass
- The class of the objects to be foundtypeMap
- The type map used in recursive object creation.
Metamodel node with given name may be mapped to different model classes. This map is used to pick the desired classes for nodes to be loaded.
By default
conditions
- Conditions which should be met by initial set of nodes (if null, all nodes are loaded)project
- The project where the object should be looked for.
public void clearCache()
public void clearCache(boolean subLevel)
subLevel
- Indicates if the sub-level cache should be clear as well.public void stats()
public boolean remove(Mappable object, org.eclipse.core.resources.IProject project) throws Exception
object
- Object to remove.project
- The project which the object belongs to.
Exception
- When Mapper use DB persistence. Remover isn't implemented for DB persistence.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |