org.oddjob.arooa.registry
Class LinkedBeanRegistry
java.lang.Object
org.oddjob.arooa.registry.SimpleBeanRegistry
org.oddjob.arooa.registry.LinkedBeanRegistry
- All Implemented Interfaces:
- BeanDirectory, BeanRegistry
public class LinkedBeanRegistry
- extends SimpleBeanRegistry
LinkedBeanRegistry
public LinkedBeanRegistry(BeanDirectory existingDirectory,
PropertyAccessor propertyAccessor,
ArooaConverter converter)
lookup
public Object lookup(String path)
- First try our local registry then the parent.
- Specified by:
lookup
in interface BeanDirectory
- Overrides:
lookup
in class SimpleBeanRegistry
- Returns:
- The resultant value or null.
lookup
public <T> T lookup(String path,
Class<T> required)
throws ArooaConversionException
- Description copied from interface:
BeanDirectory
- Get a value, as above, but also convert it into to given
type.
Conversion in the directory is required when the client code
has no access to the converters required, for instance in
a nested Oddjob.
- Specified by:
lookup
in interface BeanDirectory
- Overrides:
lookup
in class SimpleBeanRegistry
- Type Parameters:
T
- The required type.- Parameters:
path
- The full pathrequired
- The required type.
- Returns:
- An object of the required type or null if none can
be found.
- Throws:
ArooaConversionException
- If an object can be found but
it can't be converted into the required type.
getIdFor
public String getIdFor(Object bean)
- Description copied from class:
SimpleBeanRegistry
- Find the id for the given component.
- Specified by:
getIdFor
in interface BeanDirectory
- Overrides:
getIdFor
in class SimpleBeanRegistry
- Parameters:
bean
- The component.
- Returns:
- The id or null if none can be found.
getAllByType
public <T> Iterable<T> getAllByType(Class<T> type)
- Description copied from interface:
BeanDirectory
- Get all objects in the directory of the required type.
Why an Iterable not a Collection or Set? It was thought that
this would force read only use. Maybe it should be
an array...
- Specified by:
getAllByType
in interface BeanDirectory
- Overrides:
getAllByType
in class SimpleBeanRegistry
- Type Parameters:
T
- The required type.- Parameters:
type
- The type.
- Returns:
- An Iterable for matches. Never null.