JAXBContext context = JAXBContext.newInstance(StringTransformerList.class); StringTransformerList chains = (StringTransformerList) context.createUnmarshaller().unmarshal(source);
@Deprecated public class StringTransformerChainXmlParser extends Object
StringTransformerRules from XML and build an according
StringTransformerChain. The rules are proceeded in the order of their appearance in the list. <transformer-chain id="default-transformer"> <regex pattern="\.txt" replacement=""/> <regex pattern="/.foo/" replacement="" replace-all="true" stop-on-match="true"/> </transformer-chain>
| Modifier and Type | Field and Description |
|---|---|
private DomUtil |
domUtil
Deprecated.
|
private PatternCompiler |
patternCompiler
Deprecated.
|
static String |
XML_ATR_CHAIN_ID
Deprecated.
The name of the XML attribute for the ID of a
chain. |
static String |
XML_ATR_CHAIN_PARENT
Deprecated.
The name of the XML attribute for the parent of a
chain. |
static String |
XML_ATR_RULE_PATTERN
Deprecated.
The name of the XML attribute for
RegexStringTransformer.getPattern(). |
static String |
XML_ATR_RULE_REPLACEALL
Deprecated.
The name of the XML attribute for
RegexStringTransformer.isReplaceAll(). |
static String |
XML_ATR_RULE_REPLACEMENT
Deprecated.
The name of the XML attribute for
RegexStringTransformer.getReplacement(). |
static String |
XML_ATR_RULE_STOPONMATCH
Deprecated.
The name of the XML attribute for
RegexStringTransformerRule.isStopOnMatch(). |
static String |
XML_TAG_CHAIN
Deprecated.
The name of the XML element for a
StringTransformerChain. |
static String |
XML_TAG_RULE
Deprecated.
The name of the XML element for a
RegexStringTransformerRule. |
| Constructor and Description |
|---|
StringTransformerChainXmlParser()
Deprecated.
The constructor.
|
StringTransformerChainXmlParser(DomUtil domUtil)
Deprecated.
The constructor.
|
StringTransformerChainXmlParser(DomUtil domUtil,
PatternCompiler patternCompiler)
Deprecated.
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
StringTransformerChain |
parseChain(Element xmlElement,
StringTransformerChain parent)
Deprecated.
This method parses a
chain given by xmlElement. |
Map<String,StringTransformerChain> |
parseChains(Element xmlElement)
Deprecated.
This method parses a map of
chains given by xmlElement. |
StringTransformerRule |
parseRule(Element xmlElement)
Deprecated.
This method parses a
rule given by xmlElement. |
public static final String XML_TAG_CHAIN
StringTransformerChain.public static final String XML_ATR_CHAIN_ID
chain.public static final String XML_ATR_CHAIN_PARENT
chain.public static final String XML_TAG_RULE
RegexStringTransformerRule.public static final String XML_ATR_RULE_PATTERN
RegexStringTransformer.getPattern().public static final String XML_ATR_RULE_REPLACEMENT
RegexStringTransformer.getReplacement().public static final String XML_ATR_RULE_REPLACEALL
RegexStringTransformer.isReplaceAll(). Default value is
false.public static final String XML_ATR_RULE_STOPONMATCH
RegexStringTransformerRule.isStopOnMatch(). Default value is
false.private final DomUtil domUtil
StringTransformerChainXmlParser(DomUtil)private PatternCompiler patternCompiler
public StringTransformerChainXmlParser()
public StringTransformerChainXmlParser(DomUtil domUtil)
domUtil - is the DomUtil to use.public StringTransformerChainXmlParser(DomUtil domUtil, PatternCompiler patternCompiler)
domUtil - is the DomUtil to use.patternCompiler - is the PatternCompiler to use.public StringTransformerRule parseRule(Element xmlElement)
rule given by xmlElement.xmlElement - is the XML element with the transformer-rule.XML_TAG_RULEpublic StringTransformerChain parseChain(Element xmlElement, StringTransformerChain parent)
chain given by xmlElement.xmlElement - is the XML element containing the transformer-rules (see XML_TAG_RULE) as children.parent - is the parent chain to extend or null if no rules should be inherited.XML_TAG_CHAINpublic Map<String,StringTransformerChain> parseChains(Element xmlElement)
chains given by xmlElement.xmlElement - is the XML element containing the transformer-chains (see XML_TAG_CHAIN) as children and
puts them into a map with the ID as key. Unknown child elements or attributes are
simply ignored.Copyright © 2001–2015 mmm-Team. All rights reserved.