public class TagTransformation extends Object
Modifier and Type | Field | Description |
---|---|---|
static String |
VAR_END |
|
static String |
VAR_START |
Constructor | Description |
---|---|
TagTransformation() |
|
TagTransformation(String sourceTag) |
Creates new tag transformation in which specified tag will be skipped (ignored)
during parsing process.
|
TagTransformation(String sourceTag,
String destTag) |
Creates new tag transformation from source tag to target tag preserving
all source tag attributes.
|
TagTransformation(String sourceTag,
String destTag,
boolean preserveSourceAttributes) |
Creates new tag transformation from source tag to target tag specifying whether
source tag attributes are preserved.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addAttributePatternTransformation(Pattern attNamePattern,
String transformationDesc) |
|
void |
addAttributePatternTransformation(Pattern attNamePattern,
Pattern attValuePattern,
String transformationDesc) |
|
void |
addAttributePatternTransformation(AttributeTransformation attributeTransformation) |
|
void |
addAttributeTransformation(String targetAttName) |
Adds new attribute transformation in which destination attrbute will not exists
(simply removes it from list of attributes).
|
void |
addAttributeTransformation(String targetAttName,
String transformationDesc) |
Adds new attribute transformation to this tag transformation.
|
Map<String,String> |
applyTagTransformations(Map<String,String> attributes) |
|
String |
evaluateTemplate(String template,
Map<String,String> variables) |
Evaluates string template for specified map of variables.
|
public TagTransformation()
public TagTransformation(String sourceTag, String destTag, boolean preserveSourceAttributes)
sourceTag
- Name of the tag to be transformed.destTag
- Name of tag to which source tag is to be transformed.preserveSourceAttributes
- Tells whether source tag attributes are preserved in transformation.public TagTransformation(String sourceTag, String destTag)
sourceTag
- Name of the tag to be transformed.destTag
- Name of tag to which source tag is to be transformed.public TagTransformation(String sourceTag)
sourceTag
- public void addAttributeTransformation(String targetAttName, String transformationDesc)
targetAttName
- Name of the destination attributetransformationDesc
- Template describing attribute value.public void addAttributePatternTransformation(Pattern attNamePattern, String transformationDesc)
public void addAttributePatternTransformation(Pattern attNamePattern, Pattern attValuePattern, String transformationDesc)
public void addAttributePatternTransformation(AttributeTransformation attributeTransformation)
attributeTransformation
- public void addAttributeTransformation(String targetAttName)
targetAttName
- public Map<String,String> applyTagTransformations(Map<String,String> attributes)
attributes
- public String evaluateTemplate(String template, Map<String,String> variables)
template
- Template stringvariables
- Map of variables (can be null)Copyright © 2006–2018. All rights reserved.