Package me.lucko.commodore.file
Class CommodoreFileFormat
- java.lang.Object
-
- me.lucko.commodore.file.CommodoreFileFormat
-
public final class CommodoreFileFormat extends Object
The '.commodore' file format is a simplified way of representing Brigadier command node trees in a string form.This class provides a means to parse these files into real
CommandNodes.
-
-
Field Summary
Fields Modifier and Type Field Description static me.lucko.commodore.file.CommodoreFileReaderREADER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S> com.mojang.brigadier.tree.LiteralCommandNode<S>parse(File file)Parses aLiteralCommandNodefrom a commodore file.static <S> com.mojang.brigadier.tree.LiteralCommandNode<S>parse(InputStream inputStream)Parses aLiteralCommandNodefrom a commodore file.static <S> com.mojang.brigadier.tree.LiteralCommandNode<S>parse(Reader reader)Parses aLiteralCommandNodefrom a commodore file.static <S> com.mojang.brigadier.tree.LiteralCommandNode<S>parse(Path path)Parses aLiteralCommandNodefrom a commodore file.
-
-
-
Method Detail
-
parse
public static <S> com.mojang.brigadier.tree.LiteralCommandNode<S> parse(Reader reader) throws IOException
Parses aLiteralCommandNodefrom a commodore file.- Type Parameters:
S- the command node sender type- Parameters:
reader- a reader for the file- Returns:
- the command node
- Throws:
IOException- if an error occurs whilst reading the fileRuntimeException- if an error occurs whilst lexing or parsing the file- See Also:
CommodoreFileReader.parse(Reader)
-
parse
public static <S> com.mojang.brigadier.tree.LiteralCommandNode<S> parse(InputStream inputStream) throws IOException
Parses aLiteralCommandNodefrom a commodore file.- Type Parameters:
S- the command node sender type- Parameters:
inputStream- an inputStream for the file- Returns:
- the command node
- Throws:
IOException- if an error occurs whilst reading the fileRuntimeException- if an error occurs whilst lexing or parsing the file- See Also:
CommodoreFileReader.parse(InputStream)
-
parse
public static <S> com.mojang.brigadier.tree.LiteralCommandNode<S> parse(Path path) throws IOException
Parses aLiteralCommandNodefrom a commodore file.- Type Parameters:
S- the command node sender type- Parameters:
path- the path to the file- Returns:
- the command node
- Throws:
IOException- if an error occurs whilst reading the fileRuntimeException- if an error occurs whilst lexing or parsing the file- See Also:
CommodoreFileReader.parse(Path)
-
parse
public static <S> com.mojang.brigadier.tree.LiteralCommandNode<S> parse(File file) throws IOException
Parses aLiteralCommandNodefrom a commodore file.- Type Parameters:
S- the command node sender type- Parameters:
file- the file- Returns:
- the command node
- Throws:
IOException- if an error occurs whilst reading the fileRuntimeException- if an error occurs whilst lexing or parsing the file- See Also:
CommodoreFileReader.parse(File)
-
-