java.lang.Object
org.apache.wicket.injection.CompoundFieldValueFactory
- All Implemented Interfaces:
IFieldValueFactory
Compound implementation of IFieldValueFactory. This field value factory will keep trying added
factories until one returns a non-null value or all are tried.
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
-
Constructor Summary
ConstructorDescriptionCompoundFieldValueFactory
(List<IFieldValueFactory> factories) ConstructorCompoundFieldValueFactory
(IFieldValueFactory[] factories) ConstructorConstructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFactory
(IFieldValueFactory factory) Adds a factory to the compound factorygetFieldValue
(Field field, Object fieldOwner) Returns the value the field will be set toboolean
supportsField
(Field field) Returns true if the factory can generate a value for the field, false otherwise.
-
Constructor Details
-
CompoundFieldValueFactory
Constructor- Parameters:
factories
-
-
CompoundFieldValueFactory
Constructor- Parameters:
factories
-
-
CompoundFieldValueFactory
Constructor- Parameters:
f1
-f2
-
-
-
Method Details
-
addFactory
Adds a factory to the compound factory- Parameters:
factory
-
-
getFieldValue
Description copied from interface:IFieldValueFactory
Returns the value the field will be set to- Specified by:
getFieldValue
in interfaceIFieldValueFactory
- Parameters:
field
- field being injectedfieldOwner
- instance of object being injected- Returns:
- new field value
- See Also:
-
supportsField
Description copied from interface:IFieldValueFactory
Returns true if the factory can generate a value for the field, false otherwise. If this method returns false, getFieldValue() will not be called on this factory- Specified by:
supportsField
in interfaceIFieldValueFactory
- Parameters:
field
- field- Returns:
- true if the factory can generate a value for the field, false otherwise
- See Also:
-