Class EntityTypeClassInfo.EntityTypeParser

java.lang.Object
ch.njol.skript.classes.Parser<EntityType>
org.skriptlang.skript.bukkit.entity.EntityTypeClassInfo.EntityTypeParser
Enclosing class:
EntityTypeClassInfo

public static class EntityTypeClassInfo.EntityTypeParser extends Parser<EntityType>
  • Constructor Details

    • EntityTypeParser

      public EntityTypeParser()
  • Method Details

    • parse

      @Nullable public @Nullable EntityType parse(String string, ParseContext context)
      Description copied from class: Parser
      Parses 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.

      Overrides:
      parse in class Parser<EntityType>
      Parameters:
      string - The String to parse. This string is already trim()med.
      context - Context of parsing, may not be null
      Returns:
      The parsed input or null if the input is invalid for this parser.
    • toString

      public String toString(EntityType entityType, int flags)
      Description copied from class: Parser
      Returns a string representation of the given object to be used in messages.
      Specified by:
      toString in class Parser<EntityType>
      Parameters:
      entityType - The object. This will never be null.
      Returns:
      The String representation of the object.
      See Also:
    • toVariableNameString

      public String toVariableNameString(EntityType entityType)
      Description copied from class: Parser
      Returns an object's string representation in a variable name.
      Specified by:
      toVariableNameString in class Parser<EntityType>
      Parameters:
      entityType -
      Returns:
      The given object's representation in a variable name.