Package ch.njol.skript.classes
Class EnumParser<E extends Enum<E>>
java.lang.Object
ch.njol.skript.classes.Parser<E>
ch.njol.skript.classes.PatternedParser<E>
ch.njol.skript.classes.EnumParser<E>
public class EnumParser<E extends Enum<E>>
extends PatternedParser<E>
implements Converter<String,E>
-
Field Summary
Fields inherited from interface org.skriptlang.skript.lang.converter.Converter
ALL_CHAINING, ALLOW_UNSAFE_CASTS, NO_CHAINING, NO_LEFT_CHAINING, NO_RIGHT_CHAINING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts an object using this Converter.String[]Get all literal patterns.parse(String string, ParseContext context) Parses the input.Returns a string representation of the given object to be used in messages.toVariableNameString(E object) Returns an object's string representation in a variable name.Methods inherited from class ch.njol.skript.classes.PatternedParser
getCombinedPatternsMethods inherited from class ch.njol.skript.classes.Parser
canParse, getDebugMessage, toCommandString, toString
-
Constructor Details
-
Method Details
-
parse
Description copied from class:ParserParses the input. This method may print an error prior to returning null if the input couldn't be parsed.Remember to override
Parser.canParse(ParseContext)if this parser doesn't parse at all (i.e. you only use it's toString methods) or only parses for certain contexts.Note that this method will be called very frequently during script parsing, so try to avoid computationally expensive operations in this method when possible.
-
convert
Description copied from interface:ConverterConverts an object using this Converter. -
toVariableNameString
Description copied from class:ParserReturns an object's string representation in a variable name.- Specified by:
toVariableNameStringin classParser<E extends Enum<E>>- Parameters:
object-- Returns:
- The given object's representation in a variable name.
-
getPatterns
Description copied from class:PatternedParserGet all literal patterns.- Specified by:
getPatternsin classPatternedParser<E extends Enum<E>>
-
toString
Description copied from class:ParserReturns a string representation of the given object to be used in messages.
-