|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.transformer.base.StringTransformerChainXmlParser
JAXBContext context = JAXBContext.newInstance(StringTransformerList.class); StringTransformerList chains = (StringTransformerList) context.createUnmarshaller().unmarshal(source);
@Deprecated public class StringTransformerChainXmlParser
This class allows to parse a list of StringTransformerRules from XML
and build an according StringTransformerChain. The rules are
proceeded in the order of their appearance in the list.
Here is an example of a configuration (rule list) parsed by this class:
<transformer-chain id="default-transformer"> <regex pattern="\.txt" replacement=""/> <regex pattern="/.foo/" replacement="" replace-all="true" stop-on-match="true"/> </transformer-chain>
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
StringTransformerChainXmlParser()
Deprecated. The constructor. |
|
StringTransformerChainXmlParser(DomUtil domUtil)
Deprecated. The constructor. |
|
StringTransformerChainXmlParser(DomUtil domUtil,
PatternCompiler patternCompiler)
Deprecated. The constructor. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
StringTransformerChainXmlParser(DomUtil, PatternCompiler)| Constructor Detail |
|---|
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.| Method Detail |
|---|
public StringTransformerRule parseRule(Element xmlElement)
rule given by
xmlElement.
xmlElement - is the XML element with the transformer-rule.
XML_TAG_RULE
public 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||