Package org.apache.xbean.recipe
Class DefaultRepository
- java.lang.Object
-
- org.apache.xbean.recipe.DefaultRepository
-
- All Implemented Interfaces:
Repository
public class DefaultRepository extends java.lang.Object implements Repository
-
-
Constructor Summary
Constructors Constructor Description DefaultRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String name, java.lang.Object instance)Add an object instance to this repository.booleancontains(java.lang.String name)Does this repository contain a object with the specified name.java.lang.Objectget(java.lang.String name)Gets the object or recipe with the specified name from this repository.
-
-
-
Constructor Detail
-
DefaultRepository
public DefaultRepository()
-
-
Method Detail
-
contains
public boolean contains(java.lang.String name)
Does this repository contain a object with the specified name.- Specified by:
containsin interfaceRepository- Parameters:
name- the unique name of the object instance- Returns:
- true if this repository contain a object with the specified name
-
get
public java.lang.Object get(java.lang.String name)
Gets the object or recipe with the specified name from this repository.- Specified by:
getin interfaceRepository- Parameters:
name- the unique name of the object instance- Returns:
- the object instance, a recipe to build the object or null
-
add
public void add(java.lang.String name, java.lang.Object instance)
Add an object instance to this repository.- Specified by:
addin interfaceRepository- Parameters:
name- the unique name of the instanceinstance- the instance- Throws:
ConstructionException- if another object instance is already registered with the name
-
-