net.sf.mmm.util.transformer.base
Class StringTransformerChainXmlParser

java.lang.Object
  extended by net.sf.mmm.util.transformer.base.StringTransformerChainXmlParser

Deprecated. - use JAXB directly:
 JAXBContext context = JAXBContext.newInstance(StringTransformerList.class);
 StringTransformerList chains = (StringTransformerList) context.createUnmarshaller().unmarshal(source);
 

@Deprecated
public class StringTransformerChainXmlParser
extends Object

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>
 

Since:
1.0.2
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

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

XML_TAG_CHAIN

public static final String XML_TAG_CHAIN
Deprecated. 
The name of the XML element for a StringTransformerChain.

See Also:
Constant Field Values

XML_ATR_CHAIN_ID

public static final String XML_ATR_CHAIN_ID
Deprecated. 
The name of the XML attribute for the ID of a chain.

See Also:
Constant Field Values

XML_ATR_CHAIN_PARENT

public static final String XML_ATR_CHAIN_PARENT
Deprecated. 
The name of the XML attribute for the parent of a chain.

See Also:
Constant Field Values

XML_TAG_RULE

public static final String XML_TAG_RULE
Deprecated. 
The name of the XML element for a RegexStringTransformerRule.

See Also:
Constant Field Values

XML_ATR_RULE_PATTERN

public static final String XML_ATR_RULE_PATTERN
Deprecated. 
The name of the XML attribute for RegexStringTransformer.getPattern().

See Also:
Constant Field Values

XML_ATR_RULE_REPLACEMENT

public static final String XML_ATR_RULE_REPLACEMENT
Deprecated. 
The name of the XML attribute for RegexStringTransformer.getReplacement().

See Also:
Constant Field Values

XML_ATR_RULE_REPLACEALL

public static final String XML_ATR_RULE_REPLACEALL
Deprecated. 
The name of the XML attribute for RegexStringTransformer.isReplaceAll(). Default value is false.

See Also:
Constant Field Values

XML_ATR_RULE_STOPONMATCH

public static final String XML_ATR_RULE_STOPONMATCH
Deprecated. 
The name of the XML attribute for RegexStringTransformerRule.isStopOnMatch(). Default value is false.

See Also:
Constant Field Values

domUtil

private final DomUtil domUtil
Deprecated. 
See Also:
StringTransformerChainXmlParser(DomUtil)

patternCompiler

private PatternCompiler patternCompiler
Deprecated. 
See Also:
StringTransformerChainXmlParser(DomUtil, PatternCompiler)
Constructor Detail

StringTransformerChainXmlParser

public StringTransformerChainXmlParser()
Deprecated. 
The constructor.


StringTransformerChainXmlParser

public StringTransformerChainXmlParser(DomUtil domUtil)
Deprecated. 
The constructor.

Parameters:
domUtil - is the DomUtil to use.

StringTransformerChainXmlParser

public StringTransformerChainXmlParser(DomUtil domUtil,
                                       PatternCompiler patternCompiler)
Deprecated. 
The constructor.

Parameters:
domUtil - is the DomUtil to use.
patternCompiler - is the PatternCompiler to use.
Method Detail

parseRule

public StringTransformerRule parseRule(Element xmlElement)
Deprecated. 
This method parses a rule given by xmlElement.

Parameters:
xmlElement - is the XML element with the transformer-rule.
Returns:
the parsed rule.
See Also:
XML_TAG_RULE

parseChain

public StringTransformerChain parseChain(Element xmlElement,
                                         StringTransformerChain parent)
Deprecated. 
This method parses a chain given by xmlElement.

Parameters:
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.
Returns:
the parsed filter-chain.
See Also:
XML_TAG_CHAIN

parseChains

public Map<String,StringTransformerChain> parseChains(Element xmlElement)
Deprecated. 
This method parses a map of chains given by xmlElement.

Parameters:
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.
Returns:
the map of all parsed chains.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.