|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.dandelion.datatables.core.processor.AbstractConfigurationProcessor
public abstract class AbstractConfigurationProcessor
Abstract superclass for all configuration processors, table and column.
Basically, a processor processes a value then stores the processed value in
the passed TableConfiguration or ColumnConfiguration
instance.
Some processors may need to access a wider context, e.g. to register an
Extension depending on the presence of other attributes. That's why
some other objects are also passed to the process method.
Finally, some processors accept a special syntax allowing to load one or more
Dandelion bundles to the current HttpServletRequest. This syntax will
be processed only if bundleAware, which is passed in the
constructor of the processor, is set to true.
TableConfig,
ColumnConfig| Field Summary | |
|---|---|
protected boolean |
bundleAware
|
protected ColumnConfiguration |
columnConfiguration
|
protected Map.Entry<ConfigToken<?>,Object> |
configEntry
|
protected javax.servlet.http.HttpServletRequest |
request
|
protected Map<ConfigToken<?>,Object> |
stagingConf
|
protected Map<ConfigToken<?>,Extension> |
stagingExtensions
|
protected String |
stringifiedValue
|
protected TableConfiguration |
tableConfiguration
|
| Constructor Summary | |
|---|---|
AbstractConfigurationProcessor()
|
|
AbstractConfigurationProcessor(boolean bundleAware)
|
|
| Method Summary | |
|---|---|
protected void |
addColumnEntry(ConfigToken<?> configToken,
Object value)
Add a new entry to the staging configuration map of the current ColumnConfiguration instance. |
protected void |
addTableEntry(ConfigToken<?> configToken,
Object value)
Add a new entry to the staging configuration map of the current TableConfiguration instance. |
protected abstract void |
doProcess()
Processes the configuration value stored in stringifiedValue. |
protected boolean |
isColumnEntryPresent(ConfigToken<?> configToken)
Test whether the passed ConfigToken is already present in the
configuration map. |
protected boolean |
isTableEntryPresent(ConfigToken<?> configToken)
Test whether the passed ConfigToken is already present in the
configuration map. |
void |
process(Map.Entry<ConfigToken<?>,Object> configEntry,
ColumnConfiguration columnConfiguration,
TableConfiguration tableConfiguration)
Processes the passed entry which is a ConfigToken from
ColumnConfig. |
void |
process(Map.Entry<ConfigToken<?>,Object> configEntry,
TableConfiguration tableConfiguration)
Processes the passed entry which is a ConfigToken from
TableConfig. |
protected void |
registerExtension(Extension extension)
Utility method used to register an extension to the current TableConfiguration instance. |
protected void |
updateEntry(Object value)
Update the entry using with the new value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.servlet.http.HttpServletRequest request
protected TableConfiguration tableConfiguration
protected ColumnConfiguration columnConfiguration
protected Map<ConfigToken<?>,Object> stagingConf
protected Map<ConfigToken<?>,Extension> stagingExtensions
protected Map.Entry<ConfigToken<?>,Object> configEntry
protected String stringifiedValue
protected boolean bundleAware
| Constructor Detail |
|---|
public AbstractConfigurationProcessor()
public AbstractConfigurationProcessor(boolean bundleAware)
| Method Detail |
|---|
public void process(Map.Entry<ConfigToken<?>,Object> configEntry,
TableConfiguration tableConfiguration)
Processes the passed entry which is a ConfigToken from
TableConfig. The value stored in the entry will be updated
depending on the processor declared in the ConfigToken.
If new entries are to be added, they will be added in the
stagingConfigurations field of the passed
TableConfiguration instance.
process in interface ConfigurationProcessorconfigEntry - The map entry to update.tableConfiguration - The table configuration to be updated.
public void process(Map.Entry<ConfigToken<?>,Object> configEntry,
ColumnConfiguration columnConfiguration,
TableConfiguration tableConfiguration)
Processes the passed entry which is a ConfigToken from
ColumnConfig. The value stored in the entry will be updated
depending on the processor declared in the ConfigToken.
If new entries are to be added, they will be added in the
stagingConfigurations field of the passed
ColumnConfiguration instance.
process in interface ConfigurationProcessorconfigEntry - The map entry to update.columnConfiguration - The column configuration to be updated.tableConfiguration - The table configuration to be updated.protected abstract void doProcess()
Processes the configuration value stored in stringifiedValue.
protected void registerExtension(Extension extension)
Utility method used to register an extension to the current
TableConfiguration instance.
extension - The extension to register.protected void updateEntry(Object value)
Update the entry using with the new value.
Note that Map.Entry.setValue(Object) must be used because the
configuration map is being iterated on.
value - The new typed value to set in the entry.
protected void addTableEntry(ConfigToken<?> configToken,
Object value)
Add a new entry to the staging configuration map of the current
TableConfiguration instance.
The new entry cannot be directly added to the configuration map because this map is being iterated on (ConcurrentModificationException).
The staging configuration map will be merged in the final map just after
the end of the loop. See the
TableConfig.processConfiguration(com.github.dandelion.datatables.core.html.HtmlTable)
method.
configToken - The new ConfigToken to add.value - The value associated with the ConfigToken.protected boolean isTableEntryPresent(ConfigToken<?> configToken)
Test whether the passed ConfigToken is already present in the
configuration map.
In most of the cases, this is useful to initialize a entry with a default value.
configToken -
true if present, otherwise false.
protected void addColumnEntry(ConfigToken<?> configToken,
Object value)
Add a new entry to the staging configuration map of the current
ColumnConfiguration instance.
The new entry cannot be directly added to the configuration map because this map is being iterated on (ConcurrentModificationException).
The staging configuration map will be merged in the final map just after
the end of the loop. See the
ColumnConfig.processConfiguration(com.github.dandelion.datatables.core.html.HtmlColumn, com.github.dandelion.datatables.core.html.HtmlTable)
method.
configToken - The new ConfigToken to add.value - The value associated with the ConfigToken.protected boolean isColumnEntryPresent(ConfigToken<?> configToken)
Test whether the passed ConfigToken is already present in the
configuration map.
In most of the cases, this is useful to initialize a entry with a default value.
configToken -
true if present, otherwise false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||