T - the type of field to handleE - the type of field events to handleR - the type of reflection form builder to useC - the type of component to producepublic abstract class ResettableFieldHandler<T,E extends FieldUpdateEvent<T>,R extends ReflectionFormBuilder,C extends Component> extends Object implements FieldHandler<T,E,R,C>
FieldHandler.handle(java.lang.reflect.Field, java.lang.Object, de.richtercloud.reflection.form.builder.fieldhandler.FieldUpdateListener, de.richtercloud.reflection.form.builder.ReflectionFormBuilder)
final and enforcing implementation in helper handle0(java.lang.reflect.Field, java.lang.Object, de.richtercloud.reflection.form.builder.fieldhandler.FieldUpdateListener, de.richtercloud.reflection.form.builder.ReflectionFormBuilder).| Constructor and Description |
|---|
ResettableFieldHandler() |
| Modifier and Type | Method and Description |
|---|---|
JComponent |
handle(Field field,
Object instance,
FieldUpdateListener<E> updateListener,
R reflectionFormBuilder)
Information about the field value can be retrieved with
Field.get(java.lang.Object) and instance, about the
field name with Field.getName() and about the declaring class
with Field.getDeclaringClass(). |
protected abstract org.apache.commons.lang3.tuple.Pair<JComponent,ComponentHandler<?>> |
handle0(Field field,
Object instance,
FieldUpdateListener<E> updateListener,
R reflectionFormBuilder) |
void |
reset(C component) |
JComponent |
retrieveDefaultComponent(Field field) |
public final JComponent handle(Field field, Object instance, FieldUpdateListener<E> updateListener, R reflectionFormBuilder) throws FieldHandlingException, ResetException
FieldHandlerField.get(java.lang.Object) and instance, about the
field name with Field.getName() and about the declaring class
with Field.getDeclaringClass().handle in interface FieldHandler<T,E extends FieldUpdateEvent<T>,R extends ReflectionFormBuilder,C extends Component>field - the Field to be handledinstance - the instance to handleupdateListener - an FieldUpdateListener to notify on updatesreflectionFormBuilder - a ReflectionFormBuilder used for
recursionFieldHandlingException - wraps all exceptions occuring during read
or write access to fieldsResetException - if an exception during resetting the field occurspublic JComponent retrieveDefaultComponent(Field field)
protected abstract org.apache.commons.lang3.tuple.Pair<JComponent,ComponentHandler<?>> handle0(Field field, Object instance, FieldUpdateListener<E> updateListener, R reflectionFormBuilder) throws FieldHandlingException, ResetException
FieldHandlingExceptionResetExceptionpublic void reset(C component) throws ResetException
reset in interface ComponentHandler<C extends Component>ResetExceptionCopyright © 2018. All rights reserved.