Class FieldHandler
java.lang.Object
org.apache.felix.scr.impl.inject.field.FieldHandler
Handler for field references
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enum
private static class
Final state of field couldn't be found or errors occurred.private static class
Initial state.static final class
private static class
Final state of field could be found and is valid.private static interface
Internal state interface. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Class<?>
The component class.private Field
The field used for the injection.private final ReferenceMetadata
The reference metadata.private FieldHandler.State
State handling.private ValueUtils.ValueType
Value type. -
Constructor Summary
ConstructorsConstructorDescriptionFieldHandler
(ReferenceMetadata metadata, Class<?> componentClass) Create a new field handler -
Method Summary
Modifier and TypeMethodDescriptionboolean
fieldExists
(ComponentLogger logger) getBind()
private Object
getFieldValue
(Object componentInstance) getInit()
private Collection<Object>
private boolean
initField
(Object componentInstance, ComponentLogger logger) private void
setFieldValue
(Object componentInstance, Object value) (package private) void
setSearchResult
(FieldUtils.FieldSearchResult result, ComponentLogger logger) private MethodResult
updateField
(FieldHandler.METHOD_TYPE mType, Object componentInstance, BindParameters bp)
-
Field Details
-
metadata
The reference metadata. -
componentClass
The component class. -
field
The field used for the injection. -
valueType
Value type. -
state
State handling.
-
-
Constructor Details
-
FieldHandler
Create a new field handler- Parameters:
fieldName
- name of the fieldcomponentClass
- component classreferenceClassName
- service class name
-
-
Method Details
-
initField
-
getReplaceCollection
-
updateField
private MethodResult updateField(FieldHandler.METHOD_TYPE mType, Object componentInstance, BindParameters bp) throws InvocationTargetException - Throws:
InvocationTargetException
-
setFieldValue
- Throws:
InvocationTargetException
-
getFieldValue
- Throws:
InvocationTargetException
-
fieldExists
-
setSearchResult
-
getBind
-
getUnbind
-
getUpdated
-
getInit
-