Package jade

Class JadeSerializer

java.lang.Object
jade.JadeSerializer

public class JadeSerializer extends Object
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

    Constructors
    Constructor
    Description
    Constructor of the JadeSerializer, it initializes the value of pretty printing to false.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JadeSerializer

      public JadeSerializer()
      Constructor of the JadeSerializer, it initializes the value of pretty printing to false.
  • Method Details

    • serializeObjectToFile

      public void 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.
      Parameters:
      obj - object
      dir - directory
    • serializeObjectToString

      public String serializeObjectToString(JadeObject obj)
      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