Class DefaultFormFormatter
- All Implemented Interfaces:
FormFormatter
Implementation of FormFormatter used by FormFormatterInterceptor.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThread local execution state of algorithm about a field.static classThread local execution state of algorithm. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcategoriseFields(Collection<Field> formFields, Object action, Object form) Sets how fields of a form should be formatted (InterceptorContext setting property set 4).protected <T> voidCalled when processing of a form field is complete.protected voidCalled when formatting a form completes.protected voidCalled when this interceptor completes (and is not disabled).protected booleanfieldIsForm(Field actionField) Returns whether Action field is a formatted form.protected booleanfieldReceivedStoredForm(Field actionField) Returns whether field of an Action received a stored form.filterFormFields(List<Field> allFormFields) Returns form fields from parameter excluding those that are definitely not form fields and, if form was processed, excluding those linked to conversionErrors.protected voidFormats all fields of a form.voidEntry point called by older versions ofFormFormatterInterceptorthat did not allow alternate sets of converters.voidformatForms(PolicyLookup policyLookup) Entry point called byFormFormatterInterceptor.getProperties(Class<?> type) Returns all form fields of defined by form class.protected <T> DefaultFormFormatter.FieldContext<T> Returns an initial execution state about a field.protected DefaultFormFormatter.InterceptorContextReturns an initial execution state.protected <T> voidProcesses field with explicit converter or list converter, which sets formatted value (or values).Sets formatted value (or values) using explicit or default converter.protected <T> voidProcesses field with default converter or list converter, which sets formatted value (or values).protected voidProcesses all formatted values, which is to put fake, formatted versions of the forms on the Value Stack.Sets formatted value (or values) using explicit or default list converter.protected <T> voidProcesses form with manually converted fields, which calls format function and adds fake parameters to the Value Stack.protected voidProcesses string field for no conversion mode, which copies formatted value (or values) as is.protected <T> voidProcesses formatted/unformatted field pair with explicit converter or list converter, which sets formatted value (or values) and formatted half of field pair.protected voidCopies form field values to fake form.protected <T> voidCopies formatted field value (or values) to fake form.protected <T> voidstartFieldContext(DefaultFormFormatter.FieldContext.FormatMode formatType, InterceptorCommonLibrary.FieldUsage<T> fieldUsage, InterceptorCommonLibrary.PairFieldUsage<T> pairFieldUsage) Called when algorithm is about to start for a field in earnest and sets FieldContext property set 2.protected voidstartFormProcessing(Field actionField) Called before formatting a form and sets property set 3 of InterceptorContext.protected voidstartInterceptorContext(ActionInvocation invocation, PolicyLookup policyLookup)
-
Constructor Details
-
DefaultFormFormatter
public DefaultFormFormatter()
-
-
Method Details
-
categoriseFields
Sets how fields of a form should be formatted (InterceptorContext setting property set 4).
Can access InterceptorContext property set 3 and lower.
-
endFieldContext
protected <T> void endFieldContext()Called when processing of a form field is complete. Just sets end state and really exists for extending subclasses. -
endFormProcessing
protected void endFormProcessing()Called when formatting a form completes. Does nothing and really exists for extending subclasses. -
endInterceptorContext
protected void endInterceptorContext()Called when this interceptor completes (and is not disabled). Does nothing and really exists for extending subclasses. -
fieldIsForm
Returns whether Action field is a formatted form. -
fieldReceivedStoredForm
Returns whether field of an Action received a stored form. -
filterFormFields
Returns form fields from parameter excluding those that are definitely not form fields and, if form was processed, excluding those linked to conversionErrors. -
formatForm
protected void formatForm()Formats all fields of a form. Ignores forms that aren't
FormattableForm.Can access InterceptorContext property set 3 and lower.
-
getProperties
Returns all form fields of defined by form class.
Can access InterceptorContext property set 3 and lower.
-
makeFieldContext
Returns an initial execution state about a field. -
makeInterceptorContext
Returns an initial execution state. -
processAutoField
protected <T> void processAutoField()Processes field with explicit converter or list converter, which sets formatted value (or values).
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
processConverter
Sets formatted value (or values) using explicit or default converter.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
processDefaultField
protected <T> void processDefaultField()Processes field with default converter or list converter, which sets formatted value (or values).
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
processFormattedValues
protected void processFormattedValues()Processes all formatted values, which is to put fake, formatted versions of the forms on the Value Stack.
Can access all InterceptorContext properties and FieldContext property set 3 and lower.
-
processListConverter
Sets formatted value (or values) using explicit or default list converter.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
processManualParameterField
protected <T> void processManualParameterField()Processes form with manually converted fields, which calls format function and adds fake parameters to the Value Stack.
Can access all InterceptorContext properties. FieldContext does not apply.
-
processNoConversionField
protected void processNoConversionField()Processes string field for no conversion mode, which copies formatted value (or values) as is.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
processSetOnlyField
protected void processSetOnlyField()Copies form field values to fake form. Set only mode is a throwback to a previous design and only kept if subclasses want to resurrect it.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
putFakeFormField
protected <T> void putFakeFormField()Copies formatted field value (or values) to fake form.
Can access all InterceptorContext properties and FieldContext property set 3 and lower.
-
processPairField
Processes formatted/unformatted field pair with explicit converter or list converter, which sets formatted value (or values) and formatted half of field pair.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
- Throws:
Exception
-
startFieldContext
protected <T> void startFieldContext(DefaultFormFormatter.FieldContext.FormatMode formatType, InterceptorCommonLibrary.FieldUsage<T> fieldUsage, InterceptorCommonLibrary.PairFieldUsage<T> pairFieldUsage) throws Exception Called when algorithm is about to start for a field in earnest and sets FieldContext property set 2.- Throws:
Exception
-
startFormProcessing
Called before formatting a form and sets property set 3 of InterceptorContext.
Can access InterceptorContext property set 2 and lower.
- Throws:
Exception
-
startInterceptorContext
-
formatForms
public void formatForms()Entry point called by older versions ofFormFormatterInterceptorthat did not allow alternate sets of converters.- Specified by:
formatFormsin interfaceFormFormatter
-
formatForms
Entry point called byFormFormatterInterceptor.- Specified by:
formatFormsin interfaceFormFormatter
-