Class TypeParserRegistry.SimpleTypeParser<T>
java.lang.Object
com.ultikits.ultitools.abstracts.command.parser.TypeParserRegistry.SimpleTypeParser<T>
- All Implemented Interfaces:
TypeParser<T>
- Enclosing class:
TypeParserRegistry
Simple implementation of TypeParser using a parsing function.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the primary type this parser handles.intGets the priority of this parser.Gets all types this parser can handle, including array types.Parses a string value into the target type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ultikits.ultitools.abstracts.command.parser.TypeParser
parseArray, supports
-
Field Details
-
-
parseFunction
-
supportedTypes
-
priority
private final int priority
-
-
Constructor Details
-
SimpleTypeParser
-
SimpleTypeParser
-
-
Method Details
-
getPrimaryType
Description copied from interface:TypeParserGets the primary type this parser handles.- Specified by:
getPrimaryTypein interfaceTypeParser<T>- Returns:
- the primary type class
-
getSupportedTypes
Description copied from interface:TypeParserGets all types this parser can handle, including array types.- Specified by:
getSupportedTypesin interfaceTypeParser<T>- Returns:
- list of supported types
-
parse
Description copied from interface:TypeParserParses a string value into the target type.- Specified by:
parsein interfaceTypeParser<T>- Parameters:
value- the string value to parse- Returns:
- the parsed value, or null if parsing fails
- Throws:
TypeParseException- if parsing fails with an error
-
getPriority
public int getPriority()Description copied from interface:TypeParserGets the priority of this parser. Higher priority parsers are checked first. Default priority is 0.- Specified by:
getPriorityin interfaceTypeParser<T>- Returns:
- the parser priority
-