Package eu.woolplatform.utils.xml
Class StringValueParser
- java.lang.Object
-
- eu.woolplatform.utils.xml.StringValueParser
-
- All Implemented Interfaces:
XMLValueParser<String>
public class StringValueParser extends Object implements XMLValueParser<String>
Value parser for string values. It just returns the input string, but it can validate the string length.
-
-
Constructor Summary
Constructors Constructor Description StringValueParser()Constructs a new parser without string length validation.StringValueParser(int minLen, int maxLen)Constructs a new parser with string length validation.
-
-
-
Constructor Detail
-
StringValueParser
public StringValueParser()
Constructs a new parser without string length validation.
-
StringValueParser
public StringValueParser(int minLen, int maxLen)Constructs a new parser with string length validation.- Parameters:
minLen- the minimum length (0 if no minimum)maxLen- the maximum length (negative if no maximum)
-
-
Method Detail
-
parse
public String parse(String xml) throws ParseException
Description copied from interface:XMLValueParserParses the specified string value.- Specified by:
parsein interfaceXMLValueParser<String>- Parameters:
xml- the string value- Returns:
- the Java object
- Throws:
ParseException- if the string value is invalid
-
-