Gridarta Editor
ErrorGenerator.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.var.crossfire.model.validation.checks;
21 
30 import org.jetbrains.annotations.NotNull;
31 
38 public class ErrorGenerator<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> {
39 
43  @NotNull
45 
49  @NotNull
50  private final G gameObject;
51 
55  @NotNull
56  private String line = "";
57 
64  public ErrorGenerator(@NotNull final ErrorCollector<G, A, R> errorCollector, @NotNull final G gameObject) {
65  this.errorCollector = errorCollector;
66  this.gameObject = gameObject;
67  }
68 
75  public void setCurrentLine(@NotNull final String line) {
76  this.line = line;
77  }
78 
84  public void errorRegEx(@NotNull final String message) {
86  }
87 
92  public void errorMatchAllText() {
94  }
95 
100  public void errorSyntaxError(@NotNull final String reason) {
102  }
103 
108  public void errorKeywordError(@NotNull final String reason) {
110  }
111 
112 }
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.errorMatchAllText
void errorMatchAllText()
Adds a new error message for an '@match *' line with text following the '*'.
Definition: ErrorGenerator.java:92
net.sf.gridarta.var.crossfire.model.validation.errors.SuspiciousMsgRegExError
A @match line contains an invalid regular expression.
Definition: SuspiciousMsgRegExError.java:34
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.ErrorGenerator
ErrorGenerator(@NotNull final ErrorCollector< G, A, R > errorCollector, @NotNull final G gameObject)
Creates a new instance.
Definition: ErrorGenerator.java:64
net.sf.gridarta.var.crossfire.model.validation.errors.SuspiciousMsgKeywordError
A line contains a keyword related problem.
Definition: SuspiciousMsgKeywordError.java:34
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator
Generator for SuspiciousMsgChecker related error messages.
Definition: ErrorGenerator.java:38
net.sf.gridarta
Base package of all Gridarta classes.
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.errorRegEx
void errorRegEx(@NotNull final String message)
Adds a new error message for an incorrect or suspicious regular expression.
Definition: ErrorGenerator.java:84
net.sf
net.sf.gridarta.var.crossfire.model.validation.errors.SuspiciousMsgMatchAllTextError
A '@match *' line has text following the '*'.
Definition: SuspiciousMsgMatchAllTextError.java:33
net.sf.gridarta.model.archetype
Definition: AbstractArchetype.java:20
net.sf.gridarta.model.gameobject.GameObject
Reflects a game object (object on a map).
Definition: GameObject.java:36
net.sf.gridarta.var
net.sf.gridarta.model.gameobject
GameObjects are the objects based on Archetypes found on maps.
Definition: AbstractGameObject.java:20
net
net.sf.gridarta.var.crossfire.model.archetype.Archetype
Implements Crossfire archetypes.
Definition: Archetype.java:30
net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject
MapArchObject contains the specific meta data about a map that is stored in the map-arch,...
Definition: MapArchObject.java:39
net.sf.gridarta.var.crossfire
Main package of Gridarta4Crossfire, contains all classes specific to the Crossfire version of the Gri...
net.sf.gridarta.model.maparchobject.MapArchObject
Interface for MapArchObjects.
Definition: MapArchObject.java:40
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.errorSyntaxError
void errorSyntaxError(@NotNull final String reason)
Reports a general syntax error.
Definition: ErrorGenerator.java:100
net.sf.gridarta.model.validation.ErrorCollector.collect
void collect(@NotNull ValidationError< G, A, R > error)
Collect an error.
net.sf.gridarta.var.crossfire.model
net.sf.gridarta.model.validation.ErrorCollector
An interface for classes that collect errors.
Definition: ErrorCollector.java:33
net.sf.gridarta.model.validation
This package contains the framework for validating maps.
Definition: AbstractValidator.java:20
net.sf.gridarta.model
net.sf.gridarta.model.archetype.Archetype
Reflects an Archetype.
Definition: Archetype.java:41
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.errorKeywordError
void errorKeywordError(@NotNull final String reason)
Reports a keyword related error.
Definition: ErrorGenerator.java:108
net.sf.gridarta.var.crossfire.model.gameobject.GameObject
Handles the Crossfire GameObjects.
Definition: GameObject.java:41
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.gameObject
final G gameObject
The GameObject to which the error messages apply.
Definition: ErrorGenerator.java:50
net.sf.gridarta.model.maparchobject
Definition: AbstractMapArchObject.java:20
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.errorCollector
final ErrorCollector< G, A, R > errorCollector
The ErrorGenerator to which the error messages are added.
Definition: ErrorGenerator.java:44
net.sf.gridarta.var.crossfire.model.validation.errors
Definition: AbstractSuspiciousMsgError.java:20
net.sf.gridarta.var.crossfire.model.validation.errors.SuspiciousMsgSyntaxError
A line contains a general syntax error.
Definition: SuspiciousMsgSyntaxError.java:34
net.sf.gridarta.var.crossfire.model.validation
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.line
String line
The line that is currently being analyzed.
Definition: ErrorGenerator.java:56
net.sf.gridarta.var.crossfire.model.validation.checks.ErrorGenerator.setCurrentLine
void setCurrentLine(@NotNull final String line)
Sets the line currently being analyzed.
Definition: ErrorGenerator.java:75