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
ConstructorsConstructorDescriptionCompoundFieldValueFactory(List<IFieldValueFactory> factories) ConstructorCompoundFieldValueFactory(IFieldValueFactory[] factories) ConstructorConstructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFactory(IFieldValueFactory factory) Adds a factory to the compound factorygetFieldValue(Field field, Object fieldOwner) Returns the value the field will be set tobooleansupportsField(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:IFieldValueFactoryReturns the value the field will be set to- Specified by:
getFieldValuein interfaceIFieldValueFactory- Parameters:
field- field being injectedfieldOwner- instance of object being injected- Returns:
- new field value
- See Also:
-
supportsField
Description copied from interface:IFieldValueFactoryReturns 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:
supportsFieldin interfaceIFieldValueFactory- Parameters:
field- field- Returns:
- true if the factory can generate a value for the field, false otherwise
- See Also:
-