SyntaxPrinter class
Converts a SyntaxElement into its JSON string representation.
Each SyntaxElement represents a particular kind of TextMate JSON object. This class simply provides methods for converting these objects into strings. print is primarily responsible for this conversion, and printToFile can be used to easily write the results to a file.
This class follows the singleton pattern, and the methods described above can be accessed via instance. This instance requires no additional setup and completely encapsulates the responsibilities of its encoder.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
print(
SyntaxElement element) → String -
"Prints" a given
elementby converting it to a string containing its JSON representation. Each SyntaxElement represents a kind of JSON object, so passing any type of element is acceptable. -
printToFile(
SyntaxElement element, String path) → Future< void> -
"Prints" a given
elementto a given filepath. Like print, this function can convert any SyntaxElement into its JSON string representation. However, instead of returning the string, this function will write the resulting JSON into a file, returning a Future that can be used toawaitthe completion of the operation. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → SyntaxPrinter
-
The singleton instance to use to access all printing methods.
final