Package jade
Class JadeSerializer
java.lang.Object
jade.JadeSerializer
The JadeSerializer is used to convert an existing JadeObject to either a string or file.
As Jade does not care about new lines their is a pretty printing mode to improve the readability of the JadeObject.
Structure of an example Jade string:
variableOne: 'valueOne';variableTwo: 'valueTwo';
: -> used to split the variable and its value
; -> to denote the end of a variable
' -> surrounds a value of a variable
- Since:
- 2023
-
Constructor Summary
ConstructorDescriptionConstructor of the JadeSerializer, it initializes the value of pretty printing to false. -
Method Summary
Modifier and TypeMethodDescriptionvoid
serializeObjectToFile
(JadeObject obj, String dir) This method, serializeObjectToFile, writes a JadeObject to a given directory.Depending on whether pretty printing is enabled or not the structure of the file may look different.The changed structure does not affect the functionality of any of the JadeSystems.This method, serializeObjectToString, creates a string from a given JadeObject.The structure of the string may also vary depending on pretty printing but not affect its functionality.void
setPrettyPrinting
(boolean mode) Sets the value of prettyPrinting.
-
Constructor Details
-
JadeSerializer
public JadeSerializer()Constructor of the JadeSerializer, it initializes the value of pretty printing to false.
-
-
Method Details
-
serializeObjectToFile
This method, serializeObjectToFile, writes a JadeObject to a given directory.Depending on whether pretty printing is enabled or not the structure of the file may look different.The changed structure does not affect the functionality of any of the JadeSystems.- Parameters:
obj
- objectdir
- directory
-
serializeObjectToString
This method, serializeObjectToString, creates a string from a given JadeObject.The structure of the string may also vary depending on pretty printing but not affect its functionality.- Parameters:
obj
- object- Returns:
- String
-
setPrettyPrinting
public void setPrettyPrinting(boolean mode) Sets the value of prettyPrinting.- Parameters:
mode
- pretty printing mode
-