org.alfresco.repo.forms.processor
Class FieldProcessorRegistry

java.lang.Object
  extended by org.alfresco.repo.forms.processor.FieldProcessorRegistry
Direct Known Subclasses:
ContentModelFieldProcessorRegistry

public class FieldProcessorRegistry
extends java.lang.Object

Since:
3.4

Constructor Summary
FieldProcessorRegistry()
           
 
Method Summary
 Field buildField(java.lang.String fieldName, FormCreationData data)
          Attempts to build a Field.
 FieldProcessor get(java.lang.String key)
          Returns the FieldProcessor that was registered witht he specified key.
protected  FieldProcessor getFieldProcessor(java.lang.String fieldName)
           
protected  java.lang.String getKey(java.lang.String fieldName)
          Derives the key used to look up the FieldProcessor from the fieldName.
 void register(java.lang.String key, FieldProcessor processor)
          Registers a FieldProcessor with this registry using the specified key.
 void setDefaultProcessor(FieldProcessor defaultProcessor)
           
protected  boolean useDefaultProcessor(java.lang.String fieldName)
          Determines if the defaultProcessor should be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldProcessorRegistry

public FieldProcessorRegistry()
Method Detail

register

public void register(java.lang.String key,
                     FieldProcessor processor)
Registers a FieldProcessor with this registry using the specified key.

Parameters:
key -
processor -

get

public FieldProcessor get(java.lang.String key)
Returns the FieldProcessor that was registered witht he specified key.

Parameters:
key -
Returns:

buildField

public Field buildField(java.lang.String fieldName,
                        FormCreationData data)
Attempts to build a Field. The method first tries to derive a key from the fieldname, then uses this key to look up a FieldProcessor. This FieldProcessor is then used to generate a Field.

Parameters:
fieldName - the name of the field to be created.
data - A data object used by the FieldProcessor to build the Field.
Returns:
a Field or null.

getFieldProcessor

protected FieldProcessor getFieldProcessor(java.lang.String fieldName)

useDefaultProcessor

protected boolean useDefaultProcessor(java.lang.String fieldName)
Determines if the defaultProcessor should be used.

Parameters:
fieldName -
Returns:
true if the defaultProcessor should be used, otherwise false.

getKey

protected java.lang.String getKey(java.lang.String fieldName)
Derives the key used to look up the FieldProcessor from the fieldName.

Parameters:
fieldName -
Returns:
the key used to look up the FieldProcessor.

setDefaultProcessor

public void setDefaultProcessor(FieldProcessor defaultProcessor)
Parameters:
defaultProcessor - the defaultProcessor to set


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.