Klasse AttributeTransformer
- Alle implementierten Schnittstellen:
SourceTransformer
${attribute(override):newAttribute}=prefix${attribute:oldAttribute}${option:suffix}
This would add the attribute newAttribute to the current sourceElement, and its content would be (in java notation) "prefix" + (currentElement.getAttribute("oldAttribute") == null ? "" : currentElement.getAttribute("oldAttribute")) + options.getOption("suffix")
On the left hand side, one can use attribute(override) (which replaces the attribute if its already there) and attribute(noOverride) which preserves the attribute if its already there. On the right hand side, you can use either plain text, ${attribute:attributeName} and ${option:optionName} in any combination. Escape character is the backslash. Lines starting with # and empty lines are disregarded.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungtransform
(Object toTransform, ControllerState controllerState) Adds attributes to the sourceElement according to the transformDefinition.
-
Konstruktordetails
-
AttributeTransformer
Constructor.- Parameter:
transformDefinition
- the Reader from which the transformDefinition is read. The Reader is closed after processing.- Löst aus:
SourceTransformerException
- if an error occurs while reading or parsing the transformDefinition.
-
-
Methodendetails
-
transform
public Object transform(Object toTransform, ControllerState controllerState) throws SourceTransformerException Adds attributes to the sourceElement according to the transformDefinition.- Angegeben von:
transform
in SchnittstelleSourceTransformer
- Parameter:
toTransform
- the object to transform. Must be a SourceElement.controllerState
- the current state of the controller, not null.- Gibt zurück:
- the source element with the additional attributes added.
- Löst aus:
SourceTransformerException
- if an error occurs during transforming.
-