|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IAttrProcessor
Common interface for all Attribute Processors.
Every attribute processor must declare:
AttrApplicability
objects) specify the cases
in which this attribute processor would be executed. This must at least include an
attribute name (execute if attribute name is A) and can also include tag names
(execute if attribute name is A and it is set in a tag with name T), companion
attributes with values (execute if attribute name is A and it is set in a tag with
name T which has an attribute A2 with value V), etc.IValueProcessor
objects) that this attribute processor needs for being executed. This has to be declared
for dialect validation purposes at configuration time.
When developing new processors, in order to save code, it is recommended to extend an abstract class like
AbstractAttrProcessor
(or any of its subclasses) instead of directly implementing
this interface.
Method Summary | |
---|---|
Set<AttrApplicability> |
getAttributeApplicabilities()
Return the attribute applicabilities. |
Integer |
getPrecedence()
Return this processor's precedence. |
Set<Class<? extends IValueProcessor>> |
getValueProcessorDependencies()
Return this processor's dependencies. |
AttrProcessResult |
process(Arguments arguments,
TemplateResolution templateResolution,
Document document,
Element element,
Attr attribute)
Execute this attribute processor. |
Methods inherited from interface Comparable |
---|
compareTo |
Method Detail |
---|
Set<AttrApplicability> getAttributeApplicabilities()
Return the attribute applicabilities.
These applicabilities
(a set of AttrApplicability
objects) specify the cases
in which this attribute processor would be executed. This must at least include an
attribute name (execute if attribute name is A) and can also include tag names
(execute if attribute name is A and it is set in a tag with name T), companion
attributes with values (execute if attribute name is A and it is set in a tag with
name T which has an attribute A2 with value V), etc.
Refer to the AttrApplicability
API for more details.
Integer getPrecedence()
Return this processor's precedence.
When a tag includes several attributes that have an attribute processor associated, the precedences of these processors establish the order in which they will be executed (lowest precedence value is first). This is important because each attribute processor will be able to see the results of the previously executed ones.
Set<Class<? extends IValueProcessor>> getValueProcessorDependencies()
Return this processor's dependencies.
The dependencies are the set of value processors (IValueProcessor
objects) this attribute processor needs for being executed. This has to be declared
for dialect validation purposes at configuration time.
AttrProcessResult process(Arguments arguments, TemplateResolution templateResolution, Document document, Element element, Attr attribute)
Execute this attribute processor.
This execution logic will receive as parameters the execution argument
(an Arguments
object), the result of resolving the processed template
by the Template Resolver (a TemplateResolution
object), the complete DOM node tree
of the template being processed (the Document
), the tag in which
the currently executed attribute was found (the Element
) and the
attribute itself (Attr
).
arguments
- the execution arguments, containing Template Engine configuration and
execution context.templateResolution
- the result of resolving the template by the Template Resolvers.document
- the DOM node tree (document) of the template being executed.element
- the tag containing the currently executed attribute.attribute
- the attribute being executed.
AttrProcessResult
with the result of the execution.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |