Class NodeVerificationCriteria.NodeVerificationCriteriaBuilder
java.lang.Object
com.github.tadukoo.parsing.fileformat.NodeVerificationCriteria.NodeVerificationCriteriaBuilder
- Enclosing class:
- NodeVerificationCriteria
Node Verification Criteria Builder is a builder for
NodeVerificationCriteria
. It has the following
parameters:
Name | Description | Default or Required |
---|---|---|
logger | The EasyLogger to use in logging messages |
Required |
filepath | The path to the file - used in some formatting | Defaults to null |
node | The Node to be checked | Required |
format | The FormatNode that defines the expected format | Required |
nullParent | Whether to check that the parent is null or not | Defaults to false |
nullChild | Whether to check that the child is null or not | Defaults to false |
nullPrevSibling | Whether to check that the previous sibling is null or not | Defaults to false |
nullNextSibling | Whether to check that the next sibling is null or not | Defaults to false |
parent | The expected parent for the Node | Defaults to null |
child | The expected child for the Node | Defaults to null |
prevSibling | The expected previous sibling for the Node | Defaults to null |
nextSibling | The expected next sibling for the Node | Defaults to null |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Modifier and TypeFieldDescriptionprivate Node
The expected child for the Nodeprivate String
The path to the file - used in some formattingprivate FormatNode
The FormatNode that defines the expected formatprivate com.github.tadukoo.util.logger.EasyLogger
TheEasyLogger
to use in logging messagesprivate Node
The expected next sibling for the Nodeprivate Node
The Node to be checkedprivate boolean
Whether to check that the child is null or notprivate boolean
Whether to check that the next sibling is null or notprivate boolean
Whether to check that the parent is null or notprivate boolean
Whether to check that the previous sibling is null or notprivate Node
The expected parent for the Nodeprivate Node
The expected previous sibling for the Node -
Constructor Summary
ModifierConstructorDescriptionprivate
Not allowed to create this outside of FormatNodeVerification -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Actually builds theNodeVerificationCriteria
objectprivate void
Checks the currently set parameters for errors and throws an exception if there are anySets the expected child for the Node being checkedSets the path to the file to be used in some formatting checksformat
(FormatNode format) Sets the FormatNode, that defines the expected formatlogger
(com.github.tadukoo.util.logger.EasyLogger logger) Sets theEasyLogger
to use in logging messagesnextSibling
(Node nextSibling) Sets the expected next sibling for the Node being checkedSets the Node to be checkedSets to check that the child is nullSets to check that the next sibling is nullSets to check that the parent is nullSets to check that the previous sibling is nullSets the expected parent for the Node being checkedprevSibling
(Node prevSibling) Sets the expected previous sibling for the Node being checked
-
Field Details
-
logger
private com.github.tadukoo.util.logger.EasyLogger loggerTheEasyLogger
to use in logging messages -
filepath
The path to the file - used in some formatting -
node
The Node to be checked -
format
The FormatNode that defines the expected format -
nullParent
private boolean nullParentWhether to check that the parent is null or not -
nullChild
private boolean nullChildWhether to check that the child is null or not -
nullPrevSibling
private boolean nullPrevSiblingWhether to check that the previous sibling is null or not -
nullNextSibling
private boolean nullNextSiblingWhether to check that the next sibling is null or not -
parent
The expected parent for the Node -
child
The expected child for the Node -
prevSibling
The expected previous sibling for the Node -
nextSibling
The expected next sibling for the Node
-
-
Constructor Details
-
NodeVerificationCriteriaBuilder
private NodeVerificationCriteriaBuilder()Not allowed to create this outside of FormatNodeVerification
-
-
Method Details
-
logger
public NodeVerificationCriteria.NodeVerificationCriteriaBuilder logger(com.github.tadukoo.util.logger.EasyLogger logger) Sets theEasyLogger
to use in logging messages- Parameters:
logger
- TheEasyLogger
to use in logging messages- Returns:
- This builder, to continue in building
-
filepath
Sets the path to the file to be used in some formatting checks- Parameters:
filepath
- The path to the file- Returns:
- This builder, to continue in building
-
node
Sets the Node to be checked- Parameters:
node
- The Node to be checked- Returns:
- This builder, to continue in building
-
format
Sets the FormatNode, that defines the expected format- Parameters:
format
- The FormatNode that defines the expected format- Returns:
- This builder, to continue in building
-
nullParent
Sets to check that the parent is null- Returns:
- This builder, to continue in building
-
nullChild
Sets to check that the child is null- Returns:
- This builder, to continue in building
-
nullPrevSibling
Sets to check that the previous sibling is null- Returns:
- This builder, to continue in building
-
nullNextSibling
Sets to check that the next sibling is null- Returns:
- This builder, to continue in building
-
parent
Sets the expected parent for the Node being checked- Parameters:
parent
- The expected parent for the Node being checked- Returns:
- This builder, to continue building
-
child
Sets the expected child for the Node being checked- Parameters:
child
- The expected child for the Node being checked- Returns:
- This builder, to continue building
-
prevSibling
Sets the expected previous sibling for the Node being checked- Parameters:
prevSibling
- The expected previous sibling for the Node being checked- Returns:
- This builder, to continue building
-
nextSibling
Sets the expected next sibling for the Node being checked- Parameters:
nextSibling
- The expected next sibling for the Node being checked- Returns:
- This builder, to continue building
-
checkForErrors
private void checkForErrors()Checks the currently set parameters for errors and throws an exception if there are any -
build
Actually builds theNodeVerificationCriteria
object- Returns:
- The created
NodeVerificationCriteria
-