Package org.anchoranalysis.bean.define
Class Define
A bean where the definitions of many different
NamedBean
s can be specified.
These definitions are indexed by string identifiers.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a named-bean to our definitions, using the {#link GroupingRoot} annotation to determine a group where definitions are stored.<T extends AnchorBean<?>>
voidAdds all the named-beans from source to the current map.void
Adds all the named-beans from source to the current map.Creates a new bean that deep-copies every property value.<T extends AnchorBean<?>>
List<NamedBean<T>> Retrieves the list of elements associated with a grouping-root.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
Define
public Define()
-
-
Method Details
-
add
Adds a named-bean to our definitions, using the {#link GroupingRoot} annotation to determine a group where definitions are stored.Any added-bean must of a type that contains the
GroupingRoot
annotation in its class hierarchy.- Parameters:
bean
- a named-bean to add.- Throws:
DefineAddException
- if a {#link GroupingRoot} cannot be found in the class-hierarchy.
-
addAll
Adds all the named-beans from source to the current map.This is a shallow copy.
- Parameters:
source
- where to copy from.
-
addAll
Adds all the named-beans from source to the current map.This is a shallow copy.
- Type Parameters:
T
- type of bean to add.- Parameters:
list
- where to copy from.- Throws:
DefineAddException
- if a {#link GroupingRoot} cannot be found in the class-hierarchy.
-
listFor
Retrieves the list of elements associated with a grouping-root.- Type Parameters:
T
- type of elements in the list to retrieve. This should correspond togroupingRoot
or a subclass.- Parameters:
groupingRoot
- a class corresponding to a grouping-root (family-type) that may exist inDefine
.- Returns:
- a newly created list with all associated elements, or an empty-list if no elements are associated.
-
duplicateBean
Description copied from class:AnchorBean
Creates a new bean that deep-copies every property value.Any state that is not a
BeanField
is ignored.- Overrides:
duplicateBean
in classAnchorBean<Define>
- Returns:
- the newly created bean
-