W
- base class of widgets that this WidgetProcessor processesM
- Metawidget that supports this WidgetProcessorpublic interface WidgetProcessor<W,M extends W> extends Immutable
WidgetProcessors must be immutable (or, at least, appear that way to clients. They can have caches or configuration settings internally, as long as they are threadsafe). If they need to store state, they should use the Metawidget passed to each method.
Note: WidgetProcessors are an example of the Strategy design pattern.
W processWidget(W widget, String elementName, Map<String,String> attributes, M metawidget)
WidgetBuilder
, and before it is added to the Layout
.widget
- the widget to process. Never nullelementName
- XML node name of the business field. Typically 'entity', 'property' or 'action'.
Never nullattributes
- attributes of the widget to process. Never null. This Map is modifiable - changes
will be passed to subsequent WidgetProcessors and Layoutsmetawidget
- the parent Metawidget. Never nullCopyright © 2015. All Rights Reserved.