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> Iterable<T> |
getAllByType(Class<T> type)
Get all objects in the directory of the required type.
|
String |
getIdFor(Object bean)
Find the id for the given component.
|
Object |
lookup(String path)
First try our local registry then the parent.
|
<T> T |
lookup(String path,
Class<T> required)
Get a value, as above, but also convert it into to given
type.
|
getAllIds, register, remove, toStringpublic LinkedBeanRegistry(BeanDirectory existingDirectory, PropertyAccessor propertyAccessor, ArooaConverter converter)
existingDirectory - propertyAccessor - converter - public LinkedBeanRegistry(ArooaSession existingSession)
existingSession - public Object lookup(String path)
lookup in interface BeanDirectorylookup in class SimpleBeanRegistrypath - The path.public <T> T lookup(String path, Class<T> required) throws ArooaConversionException
BeanDirectoryConversion 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 BeanDirectorylookup in class SimpleBeanRegistryT - 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 String getIdFor(Object bean)
SimpleBeanRegistrygetIdFor in interface BeanDirectorygetIdFor in class SimpleBeanRegistrybean - The component.public <T> Iterable<T> getAllByType(Class<T> type)
BeanDirectoryWhy 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 BeanDirectorygetAllByType in class SimpleBeanRegistryT - The required type.type - The type.Copyright © 2023. All rights reserved.