 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.var.crossfire.model.validation.checks;
25 import org.apache.log4j.Category;
26 import org.apache.log4j.Logger;
27 import org.jetbrains.annotations.NotNull;
35 @SuppressWarnings(
"DuplicateBranchesInSwitch")
48 private State state = State.N;
54 if (LOG.isDebugEnabled()) {
55 LOG.debug(
"init: state=" + state);
65 if (LOG.isDebugEnabled()) {
66 LOG.debug(
"reset: state=" + state);
75 if (LOG.isDebugEnabled()) {
76 LOG.debug(
"event: text");
81 generator.errorSyntaxError(
"text before @match");
101 throw new AssertionError(
"state=" + state);
109 if (LOG.isDebugEnabled()) {
110 LOG.debug(
"event: empty");
115 generator.errorSyntaxError(
"text before @match");
123 generator.errorSyntaxError(
"the text starts with an empty line");
132 generator.errorSyntaxError(
"the text contains more than one consecutive empty line");
140 throw new AssertionError(
"state=" + state);
148 if (LOG.isDebugEnabled()) {
149 LOG.debug(
"event: match");
166 generator.errorSyntaxError(
"the text ends with an empty line");
175 throw new AssertionError(
"state=" + state);
183 if (LOG.isDebugEnabled()) {
184 LOG.debug(
"event: reply");
187 generator.errorSyntaxError(
"@reply or @question should not be used for a magic ear");
195 if (LOG.isDebugEnabled()) {
196 LOG.debug(
"event: eof");
207 generator.errorSyntaxError(
"the text ends with an empty line");
214 throw new AssertionError(
"state=" + state);
221 private void setState(@NotNull
final State state) {
222 if (this.state == state) {
226 if (LOG.isDebugEnabled()) {
227 LOG.debug(
"state=" + state);
Generator for SuspiciousMsgChecker related error messages.
Base package of all Gridarta classes.
void match(@NotNull final ErrorGenerator< G, A, R > generator)
Processes a @match line.
Checks for suspicious text lines in magic ears.
void eof(@NotNull final ErrorGenerator< G, A, R > generator)
Will be called at the end of processing.
Reflects a game object (object on a map).
T
The last processed line was a non-empty text line.
void setState(@NotNull final State state)
Updates state and prints a debug message if it changes.
GameObjects are the objects based on Archetypes found on maps.
Implements Crossfire archetypes.
MapArchObject contains the specific meta data about a map that is stored in the map-arch,...
void reply(@NotNull final ErrorGenerator< G, A, R > generator)
Processes a qreply or @question line.
Interface for MapArchObjects.
void text(@NotNull final ErrorGenerator< G, A, R > generator)
Processes a non-empty line of text.
void empty(@NotNull final ErrorGenerator< G, A, R > generator)
Processes an empty line of text.
N2
Nothing processed yet but an error message has been printed.
Handles the Crossfire GameObjects.
M
A @match line has been processed.
TE
The last processed line was an empty text line.
MagicEarValidator()
Creates a new instance.
void reset()
Resets the checker state.