Class TadFormatNodeHeader
java.lang.Object
com.github.tadukoo.parsing.fileformat.TadFormatNodeHeader
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 Summary
Modifier and TypeFieldDescriptionprivate static final String
The name for the File Format Nodestatic final String
The name for the Head Tad Format Nodeprivate static final String
The name for the File Format Schema Nodestatic final int
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.private static final String
The name for the Tad Format Version Number Nodeprivate static final String
The name for the File Format Schema Version Number Nodeprivate static final String
The name for the File Format Schema Version Node -
Constructor Summary
ModifierConstructorDescriptionprivate
Not allowed to create a TadFormatNodeHeader -
Method Summary
Modifier and TypeMethodDescriptionstatic Node
createHeader
(FileFormat format, FileFormatSchema schema) Creates a Tad Format Header for the givenFileFormat
andFileFormatSchema
.private static FormatNode
getFileFormatNode
(com.github.tadukoo.util.logger.EasyLogger logger, FileFormat format) Creates aFormatNode
for the File Format Node.private static FormatNode
getHeadFormatNode
(com.github.tadukoo.util.logger.EasyLogger logger) Creates aFormatNode
for the head Node of the Tad Format Header.private static FormatNode
getSchemaNode
(com.github.tadukoo.util.logger.EasyLogger logger) Creates aFormatNode
for the File Format Schema Node.static String
getSchemaVersionString
(Node headNode) Grabs the Schema version string out of the Tad Format Node Header.private static FormatNode
getTadVersionNode
(com.github.tadukoo.util.logger.EasyLogger logger) Creates aFormatNode
for the Tad Format Version Node.private static FormatNode
getVersionNumNode
(com.github.tadukoo.util.logger.EasyLogger logger, FileFormatSchema schema) Creates aFormatNode
for the File Format Schema Version Number Node.private static FormatNode
getVersionStringNode
(com.github.tadukoo.util.logger.EasyLogger logger, FileFormatSchema schema) Creates aFormatNode
for the File Format Schema Version Node.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.
-
Field Details
-
TAD_FORMAT_VERSION_NUM
public static final int TAD_FORMAT_VERSION_NUMThis 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
The name for the Head Tad Format Node- See Also:
-
TAD_VERSION_NUMBER
The name for the Tad Format Version Number Node- See Also:
-
FILE_FORMAT
The name for the File Format Node- See Also:
-
SCHEMA
The name for the File Format Schema Node- See Also:
-
VERSION_STRING
The name for the File Format Schema Version Node- See Also:
-
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
Creates aFormatNode
for the head Node of the Tad Format Header.- Parameters:
logger
- TheEasyLogger
to use in logging any issues- Returns:
- The FormatNode for the head Tad Format Header Node
-
getTadVersionNode
Creates aFormatNode
for the Tad Format Version Node.- Parameters:
logger
- TheEasyLogger
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 aFormatNode
for the File Format Node.- Parameters:
logger
- TheEasyLogger
to use in logging any issuesformat
- TheFileFormat
to use for information- Returns:
- The FormatNode for the File Format Node
-
getSchemaNode
Creates aFormatNode
for the File Format Schema Node.- Parameters:
logger
- TheEasyLogger
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 aFormatNode
for the File Format Schema Version Node.- Parameters:
logger
- TheEasyLogger
to use in logging any issuesschema
- TheFileFormatSchema
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 aFormatNode
for the File Format Schema Version Number Node.- Parameters:
logger
- TheEasyLogger
to use in logging any issuesschema
- TheFileFormatSchema
to use for information- Returns:
- The FormatNode for the File Format Schema Version Number Node
-
createHeader
Creates a Tad Format Header for the givenFileFormat
andFileFormatSchema
.- Parameters:
format
- The FileFormat used for certain parametersschema
- The FileFormatSchema used for certain parameters- Returns:
- The head Node created for this header
-
getSchemaVersionString
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
- TheEasyLogger
to use in logging any issues or successestadFormatNode
- The Tad Format Node being checkedformat
- The FileFormat to use in checking parametersschema
- The FileFormatSchema to use in checking parameters- Returns:
- Whether the Tad Format Node was the correct format or not
-