Package org.oddjob.arooa.registry
Class LinkedBeanRegistry
java.lang.Object
org.oddjob.arooa.registry.SimpleBeanRegistry
org.oddjob.arooa.registry.LinkedBeanRegistry
- All Implemented Interfaces:
BeanDirectory,BeanRegistry
A
BeanRegistry that will attempt to find a bean value in an
existing BeanDirectory if it hasn't been registered with this
registry.- Author:
- rob
-
Field Summary
Fields inherited from class org.oddjob.arooa.registry.SimpleBeanRegistry
RESERVED_CHARACTERS -
Constructor Summary
ConstructorsConstructorDescriptionLinkedBeanRegistry(ArooaSession existingSession) A constructor that takes takes the existing directory and tools from the given session.LinkedBeanRegistry(BeanDirectory existingDirectory, PropertyAccessor propertyAccessor, ArooaConverter converter) Constructor. -
Method Summary
Modifier and TypeMethodDescription<T> Iterable<T> getAllByType(Class<T> type) Get all objects in the directory of the required type.Find the id for the given component.First try our local registry then the parent.<T> TGet a value, as above, but also convert it into to given type.Methods inherited from class org.oddjob.arooa.registry.SimpleBeanRegistry
getAllIds, register, remove, toString
-
Constructor Details
-
LinkedBeanRegistry
public LinkedBeanRegistry(BeanDirectory existingDirectory, PropertyAccessor propertyAccessor, ArooaConverter converter) Constructor.- Parameters:
existingDirectory-propertyAccessor-converter-
-
LinkedBeanRegistry
A constructor that takes takes the existing directory and tools from the given session.- Parameters:
existingSession-
-
-
Method Details
-
lookup
First try our local registry then the parent.- Specified by:
lookupin interfaceBeanDirectory- Overrides:
lookupin classSimpleBeanRegistry- Parameters:
path- The path.- Returns:
- The resultant value or null.
-
lookup
Description copied from interface:BeanDirectoryGet 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:
lookupin interfaceBeanDirectory- Overrides:
lookupin classSimpleBeanRegistry- 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
Description copied from class:SimpleBeanRegistryFind the id for the given component.- Specified by:
getIdForin interfaceBeanDirectory- Overrides:
getIdForin classSimpleBeanRegistry- Parameters:
bean- The component.- Returns:
- The id or null if none can be found.
-
getAllByType
Description copied from interface:BeanDirectoryGet 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:
getAllByTypein interfaceBeanDirectory- Overrides:
getAllByTypein classSimpleBeanRegistry- Type Parameters:
T- The required type.- Parameters:
type- The type.- Returns:
- An Iterable for matches. Never null.
-