Class DefaultFormFormatter
- All Implemented Interfaces:
FormFormatter
Implementation of FormFormatter
used by FormFormatterInterceptor
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Thread local execution state of algorithm about a field.static class
Thread local execution state of algorithm. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncategoriseFields
(Collection<Field> formFields, Object action, Object form) Sets how fields of a form should be formatted (InterceptorContext setting property set 4).protected <T> void
Called when processing of a form field is complete.protected void
Called when formatting a form completes.protected void
Called when this interceptor completes (and is not disabled).protected boolean
fieldIsForm
(Field actionField) Returns whether Action field is a formatted form.protected boolean
fieldReceivedStoredForm
(Field actionField) Returns whether field of an Action received a stored form.protected Collection
<Field> filterFormFields
(Collection<Field> allFormFields) Returns form fields from parameter excluding those that are definitely not a form fields.protected void
Formats all fields of a form.void
Entry point called byFormFormatterInterceptor
.protected Collection
<Field> getProperties
(Class<?> type) Returns all form fields of defined by form class.protected <T> DefaultFormFormatter.FieldContext
<T> protected DefaultFormFormatter.InterceptorContext
protected <T> void
Formats non-string form field annotated by converter.protected <T> String
protected <T> String
protected <T> void
Formats non-string form field not annotated by converter, using default converter.protected void
protected <T> void
protected void
Called for string form fields, which just copies form field value to fake form.protected <T> void
protected void
Called for string arrays and string collection form fields, which just copies form field values to fake form.protected <T> void
protected <T> void
protected <T> void
startFieldContext
(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 void
startFormProcessing
(Field actionField) Called before formatting a form and sets property set 3 of InterceptorContext.protected void
startInterceptorContext
(com.opensymphony.xwork2.ActionInvocation invocation)
-
Constructor Details
-
DefaultFormFormatter
public DefaultFormFormatter()
-
-
Method Details
-
categoriseFields
protected InterceptorCommonLibrary.CategoriseFieldResult categoriseFields(Collection<Field> formFields, Object action, Object form) 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 a form fields. -
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
-
makeInterceptorContext
-
processAutoField
protected <T> void processAutoField()Formats non-string form field annotated by converter.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
processCollectionConverter
-
processConverter
-
processDefaultField
protected <T> void processDefaultField()Formats non-string form field not annotated by converter, using default converter.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
processFormattedValues
protected void processFormattedValues() -
processManualParameterField
protected <T> void processManualParameterField() -
processNoConversionField
protected void processNoConversionField()Called for string form fields, which just copies form field value to fake form.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
processSetOnlyField
protected void processSetOnlyField()Called for string arrays and string collection form fields, which just copies form field values to fake form.
Can access all InterceptorContext properties and FieldContext property set 2 and lower.
-
putFakeMultipleFormField
protected <T> void putFakeMultipleFormField() -
putFakeFormField
protected <T> void putFakeFormField() -
processPairField
- 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
protected void startInterceptorContext(com.opensymphony.xwork2.ActionInvocation invocation) -
formatForms
public void formatForms()Entry point called byFormFormatterInterceptor
.- Specified by:
formatForms
in interfaceFormFormatter
-