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
FieldsModifier and TypeFieldDescriptionprivate static final StringThe name for the File Format Nodestatic final StringThe name for the Head Tad Format Nodeprivate static final StringThe name for the File Format Schema Nodestatic final intThis 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 StringThe name for the Tad Format Version Number Nodeprivate static final StringThe name for the File Format Schema Version Number Nodeprivate static final StringThe name for the File Format Schema Version Node -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNot allowed to create a TadFormatNodeHeader -
Method Summary
Modifier and TypeMethodDescriptionstatic NodecreateHeader(FileFormat format, FileFormatSchema schema) Creates a Tad Format Header for the givenFileFormatandFileFormatSchema.private static FormatNodegetFileFormatNode(com.github.tadukoo.util.logger.EasyLogger logger, FileFormat format) Creates aFormatNodefor the File Format Node.private static FormatNodegetHeadFormatNode(com.github.tadukoo.util.logger.EasyLogger logger) Creates aFormatNodefor the head Node of the Tad Format Header.private static FormatNodegetSchemaNode(com.github.tadukoo.util.logger.EasyLogger logger) Creates aFormatNodefor the File Format Schema Node.static StringgetSchemaVersionString(Node headNode) Grabs the Schema version string out of the Tad Format Node Header.private static FormatNodegetTadVersionNode(com.github.tadukoo.util.logger.EasyLogger logger) Creates aFormatNodefor the Tad Format Version Node.private static FormatNodegetVersionNumNode(com.github.tadukoo.util.logger.EasyLogger logger, FileFormatSchema schema) Creates aFormatNodefor the File Format Schema Version Number Node.private static FormatNodegetVersionStringNode(com.github.tadukoo.util.logger.EasyLogger logger, FileFormatSchema schema) Creates aFormatNodefor the File Format Schema Version Node.static booleanverifyTadFormatNode(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 aFormatNodefor the head Node of the Tad Format Header.- Parameters:
logger- TheEasyLoggerto use in logging any issues- Returns:
- The FormatNode for the head Tad Format Header Node
-
getTadVersionNode
Creates aFormatNodefor the Tad Format Version Node.- Parameters:
logger- TheEasyLoggerto 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 aFormatNodefor the File Format Node.- Parameters:
logger- TheEasyLoggerto use in logging any issuesformat- TheFileFormatto use for information- Returns:
- The FormatNode for the File Format Node
-
getSchemaNode
Creates aFormatNodefor the File Format Schema Node.- Parameters:
logger- TheEasyLoggerto 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 aFormatNodefor the File Format Schema Version Node.- Parameters:
logger- TheEasyLoggerto use in logging any issuesschema- TheFileFormatSchemato 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 aFormatNodefor the File Format Schema Version Number Node.- Parameters:
logger- TheEasyLoggerto use in logging any issuesschema- TheFileFormatSchemato use for information- Returns:
- The FormatNode for the File Format Schema Version Number Node
-
createHeader
Creates a Tad Format Header for the givenFileFormatandFileFormatSchema.- 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- TheEasyLoggerto 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
-