Class FieldProcessorRegistry
java.lang.Object
org.alfresco.repo.forms.processor.FieldProcessorRegistry
- Direct Known Subclasses:
ContentModelFieldProcessorRegistry
Holds a FieldProcessor implementation for the fields that can be processed by the FormProcessor.
- Since:
- 3.4
- Author:
- Nick Smith
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildField(String fieldName, FormCreationData data) Attempts to build aField.Returns theFieldProcessorthat was registered witht he specified key.protected FieldProcessorgetFieldProcessor(String fieldName) Returns a FieldProcessor for the given field name.protected StringDerives the key used to look up theFieldProcessorfrom the fieldName.voidregister(String key, FieldProcessor processor) Registers aFieldProcessorwith this registry using the specified key.voidsetDefaultProcessor(FieldProcessor defaultProcessor) Sets the default field processor instance.protected booleanuseDefaultProcessor(String fieldName) Determines if the defaultProcessor should be used.
-
Constructor Details
-
FieldProcessorRegistry
public FieldProcessorRegistry()
-
-
Method Details
-
register
Registers aFieldProcessorwith this registry using the specified key.- Parameters:
key- Stringprocessor- FieldProcessor
-
get
Returns theFieldProcessorthat was registered witht he specified key.- Parameters:
key- String- Returns:
- FieldProcessor
-
buildField
Attempts to build aField. The method first tries to derive a key from the fieldname, then uses this key to look up aFieldProcessor. ThisFieldProcessoris then used to generate aField.- Parameters:
fieldName- the name of the field to be created.data- A data object used by theFieldProcessorto build theField.- Returns:
- a
Fieldornull.
-
getFieldProcessor
Returns a FieldProcessor for the given field name.- Parameters:
fieldName- String- Returns:
- The FieldProcessor implementation for the field or null if there isn't one regsitered.
-
useDefaultProcessor
Determines if the defaultProcessor should be used.- Parameters:
fieldName- String- Returns:
trueif the defaultProcessor should be used, otherwisefalse.
-
getKey
Derives the key used to look up theFieldProcessorfrom the fieldName.- Parameters:
fieldName- String- Returns:
- the key used to look up the
FieldProcessor.
-
setDefaultProcessor
Sets the default field processor instance.- Parameters:
defaultProcessor- the defaultProcessor to set
-