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
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.SortedMap<java.lang.String,java.lang.Object>
instances
The unmarshaled object instances by name.
-
Constructor Summary
Constructors Constructor Description DefaultRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.String name, java.lang.Object instance)
Add an object instance to this repository.boolean
contains(java.lang.String name)
Does this repository contain a object with the specified name.java.lang.Object
get(java.lang.String name)
Gets the object or recipe with the specified name from this repository.
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.String name)
Does this repository contain a object with the specified name.- Specified by:
contains
in 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:
get
in 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:
add
in interfaceRepository
- Parameters:
name
- the unique name of the instanceinstance
- the instance- Throws:
ConstructionException
- if another object instance is already registered with the name
-
-