org.specrunner.plugins.core.objects.core
Class ObjectManagerDefault

java.lang.Object
  extended by org.specrunner.plugins.core.objects.core.ObjectManagerDefault
All Implemented Interfaces:
IObjectManager

public class ObjectManagerDefault
extends Object
implements IObjectManager

Manages the set of AbstractPluginObject created on a given specification.

Author:
Thiago Santos

Field Summary
protected  Map<Class<?>,AbstractPluginObject> entities
          Map of instances for a given entity.
 
Constructor Summary
ObjectManagerDefault()
           
 
Method Summary
 void bind(AbstractPluginObject input)
          Bind a object plugin to the manager.
 void clear()
          Clear all object mappings.
 Map<Class<?>,AbstractPluginObject> getEntities()
          The mapping of all entities.
 boolean isBound(Class<?> clazz)
          Check if a given class is bound to a AbstractPluginObject.
 Object lookup(Class<?> clazz, String key)
          Lookup for a object of a given type, with the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entities

protected Map<Class<?>,AbstractPluginObject> entities
Map of instances for a given entity.

Constructor Detail

ObjectManagerDefault

public ObjectManagerDefault()
Method Detail

isBound

public boolean isBound(Class<?> clazz)
Description copied from interface: IObjectManager
Check if a given class is bound to a AbstractPluginObject.

Specified by:
isBound in interface IObjectManager
Parameters:
clazz - The object type.
Returns:
true, of bound, false, otherwise.

bind

public void bind(AbstractPluginObject input)
Description copied from interface: IObjectManager
Bind a object plugin to the manager.

Specified by:
bind in interface IObjectManager
Parameters:
input - The object plugin.

lookup

public Object lookup(Class<?> clazz,
                     String key)
              throws PluginException
Description copied from interface: IObjectManager
Lookup for a object of a given type, with the given key.

Specified by:
lookup in interface IObjectManager
Parameters:
clazz - The object type.
key - The object key.
Returns:
The object if exists,null, otherwise.
Throws:
PluginException - On lookup errors.

getEntities

public Map<Class<?>,AbstractPluginObject> getEntities()
Description copied from interface: IObjectManager
The mapping of all entities.

Specified by:
getEntities in interface IObjectManager
Returns:
The entity mapping.

clear

public void clear()
Description copied from interface: IObjectManager
Clear all object mappings.

Specified by:
clear in interface IObjectManager


Copyright © 2014. All rights reserved.