Class TadFormatNodeHeader

java.lang.Object
com.github.tadukoo.parsing.fileformat.TadFormatNodeHeader

public class TadFormatNodeHeader extends Object
This class defines the Tad Format Node Header section that should be at the top of all files.
Since:
Alpha v.0.1
Version:
Alpha v.0.3
Author:
Logan Ferree (Tadukoo)
  • Field Details

    • TAD_FORMAT_VERSION_NUM

      public static final int TAD_FORMAT_VERSION_NUM
      This will be updated if the general Tad Format changes, and there will be a way in the future to update between Tad Format Versions. Note: This does not directly correspond to the current project's version, only to actual formatting changes.
      See Also:
    • HEAD_NAME

      public static final String HEAD_NAME
      The name for the Head Tad Format Node
      See Also:
    • TAD_VERSION_NUMBER

      private static final String TAD_VERSION_NUMBER
      The name for the Tad Format Version Number Node
      See Also:
    • FILE_FORMAT

      private static final String FILE_FORMAT
      The name for the File Format Node
      See Also:
    • SCHEMA

      private static final String SCHEMA
      The name for the File Format Schema Node
      See Also:
    • VERSION_STRING

      private static final String VERSION_STRING
      The name for the File Format Schema Version Node
      See Also:
    • VERSION_NUMBER

      private static final String VERSION_NUMBER
      The name for the File Format Schema Version Number Node
      See Also:
  • Constructor Details

    • TadFormatNodeHeader

      private TadFormatNodeHeader()
      Not allowed to create a TadFormatNodeHeader
  • Method Details

    • getHeadFormatNode

      private static FormatNode getHeadFormatNode(com.github.tadukoo.util.logger.EasyLogger logger)
      Creates a FormatNode for the head Node of the Tad Format Header.
      Parameters:
      logger - The EasyLogger to use in logging any issues
      Returns:
      The FormatNode for the head Tad Format Header Node
    • getTadVersionNode

      private static FormatNode getTadVersionNode(com.github.tadukoo.util.logger.EasyLogger logger)
      Creates a FormatNode for the Tad Format Version Node.
      Parameters:
      logger - The EasyLogger to use in logging any issues
      Returns:
      The FormatNode for the Tad Format Version Node
    • getFileFormatNode

      private static FormatNode getFileFormatNode(com.github.tadukoo.util.logger.EasyLogger logger, FileFormat format)
      Creates a FormatNode for the File Format Node.
      Parameters:
      logger - The EasyLogger to use in logging any issues
      format - The FileFormat to use for information
      Returns:
      The FormatNode for the File Format Node
    • getSchemaNode

      private static FormatNode getSchemaNode(com.github.tadukoo.util.logger.EasyLogger logger)
      Creates a FormatNode for the File Format Schema Node.
      Parameters:
      logger - The EasyLogger to use in logging any issues
      Returns:
      The FormatNode for the File Format Schema Node
    • getVersionStringNode

      private static FormatNode getVersionStringNode(com.github.tadukoo.util.logger.EasyLogger logger, FileFormatSchema schema)
      Creates a FormatNode for the File Format Schema Version Node.
      Parameters:
      logger - The EasyLogger to use in logging any issues
      schema - The FileFormatSchema to use for information
      Returns:
      The FormatNode for the File Format Schema Version Node
    • getVersionNumNode

      private static FormatNode getVersionNumNode(com.github.tadukoo.util.logger.EasyLogger logger, FileFormatSchema schema)
      Creates a FormatNode for the File Format Schema Version Number Node.
      Parameters:
      logger - The EasyLogger to use in logging any issues
      schema - The FileFormatSchema to use for information
      Returns:
      The FormatNode for the File Format Schema Version Number Node
    • createHeader

      public static Node createHeader(FileFormat format, FileFormatSchema schema)
      Creates a Tad Format Header for the given FileFormat and FileFormatSchema.
      Parameters:
      format - The FileFormat used for certain parameters
      schema - The FileFormatSchema used for certain parameters
      Returns:
      The head Node created for this header
    • getSchemaVersionString

      public static String getSchemaVersionString(Node headNode)
      Grabs the Schema version string out of the Tad Format Node Header.
      Parameters:
      headNode - The head Node of the header
      Returns:
      The version string used for the schema
    • verifyTadFormatNode

      public static boolean verifyTadFormatNode(com.github.tadukoo.util.logger.EasyLogger logger, Node tadFormatNode, FileFormat format, FileFormatSchema schema)
      Verifies that the Tad Format Node is correct at the top of a file.
      Parameters:
      logger - The EasyLogger to use in logging any issues or successes
      tadFormatNode - The Tad Format Node being checked
      format - The FileFormat to use in checking parameters
      schema - The FileFormatSchema to use in checking parameters
      Returns:
      Whether the Tad Format Node was the correct format or not