public class LinkedBeanRegistry extends SimpleBeanRegistry
BeanRegistry
that will attempt to find a bean value in an
existing BeanDirectory
if it hasn't been registered with this
registry.RESERVED_CHARACTERS
Constructor and Description |
---|
LinkedBeanRegistry(ArooaSession existingSession)
A constructor that takes takes the existing directory and tools
from the given session.
|
LinkedBeanRegistry(BeanDirectory existingDirectory,
PropertyAccessor propertyAccessor,
ArooaConverter converter)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> java.lang.Iterable<T> |
getAllByType(java.lang.Class<T> type)
Get all objects in the directory of the required type.
|
java.lang.String |
getIdFor(java.lang.Object bean)
Find the id for the given component.
|
java.lang.Object |
lookup(java.lang.String path)
First try our local registry then the parent.
|
<T> T |
lookup(java.lang.String path,
java.lang.Class<T> required)
Get a value, as above, but also convert it into to given
type.
|
getAllIds, register, remove, toString
public LinkedBeanRegistry(BeanDirectory existingDirectory, PropertyAccessor propertyAccessor, ArooaConverter converter)
existingDirectory
- propertyAccessor
- converter
- public LinkedBeanRegistry(ArooaSession existingSession)
existingSession
- public java.lang.Object lookup(java.lang.String path)
lookup
in interface BeanDirectory
lookup
in class SimpleBeanRegistry
path
- The path.public <T> T lookup(java.lang.String path, java.lang.Class<T> required) throws ArooaConversionException
BeanDirectory
Conversion in the directory is required when the client code has no access to the converters required, for instance in a nested Oddjob.
lookup
in interface BeanDirectory
lookup
in class SimpleBeanRegistry
T
- The required type.path
- The full pathrequired
- The required type.ArooaConversionException
- If an object can be found but
it can't be converted into the required type.public java.lang.String getIdFor(java.lang.Object bean)
SimpleBeanRegistry
getIdFor
in interface BeanDirectory
getIdFor
in class SimpleBeanRegistry
bean
- The component.public <T> java.lang.Iterable<T> getAllByType(java.lang.Class<T> type)
BeanDirectory
Why an Iterable not a Collection or Set? It was thought that this would force read only use. Maybe it should be an array...
getAllByType
in interface BeanDirectory
getAllByType
in class SimpleBeanRegistry
T
- The required type.type
- The type.