Package org.openstreetmap.josm.tools
Class StringParser
- java.lang.Object
-
- org.openstreetmap.josm.tools.GenericParser<String>
-
- org.openstreetmap.josm.tools.StringParser
-
public class StringParser extends GenericParser<String>
Utility class to parse various types from strings.- Since:
- 16181
-
-
Field Summary
Fields Modifier and Type Field Description static StringParser
DEFAULT
-
Fields inherited from class org.openstreetmap.josm.tools.GenericParser
parsers
-
-
Constructor Summary
Constructors Modifier Constructor Description StringParser()
Creates an emptyStringParser
private
StringParser(Map<Class<?>,Function<String,?>> parsers)
StringParser(StringParser parser)
Creates a newStringParser
by deeply copyingparser
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> StringParser
registerParser(Class<T> type, Function<String,T> value)
-
Methods inherited from class org.openstreetmap.josm.tools.GenericParser
parse, supports, tryParse
-
-
-
-
Field Detail
-
DEFAULT
public static final StringParser DEFAULT
-
-
Constructor Detail
-
StringParser
public StringParser()
Creates an emptyStringParser
-
StringParser
public StringParser(StringParser parser)
Creates a newStringParser
by deeply copyingparser
- Parameters:
parser
- the parser to copy
-
StringParser
private StringParser(Map<Class<?>,Function<String,?>> parsers)
-
-
Method Detail
-
registerParser
public <T> StringParser registerParser(Class<T> type, Function<String,T> value)
- Overrides:
registerParser
in classGenericParser<String>
-
-