2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.model
.common
;
11 import java
.util
.List
;
13 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
20 public interface IParsable
{
23 * Returns an integer value indicating whether the used parser
24 * method was able to parse a string successfully into this object (<code>0</code>)
25 * or not (<code>!=0</code>). The the parsing was not successful the value returned
26 * defines in more detail what the problem was. The definition of these values depends
27 * on the parser that has been used for parsing.
29 * @return the int value parsingProblem
31 public int getParsingProblem();
34 * @see #getParsingProblem()
36 public void setParsingProblem(int hasProblem
);
39 * Returns true if any parsing problem (warning or error) exists.
41 * @see #getHasProblem()
43 public boolean hasProblem();
46 * Returns true, if the specified problem exists. False otherwise.
50 public boolean hasProblem(ParserProblem problem
);
54 * Returns a list of all warnings and errors that have been recognized during the parsing
55 * and not yet handled.
58 public List
<ParserProblem
> getParsingProblems();
61 * Adds a parsing problem to the list of parsing problems
64 public void addParsingProblem(ParserProblem problem
);
67 * Removes a parsing problem from the list of parsing problems.
68 * If the problem is not in the list or is <code>null</code>, nothing happens.
70 */public void removeParsingProblem(ParserProblem problem
);
74 * Returns the integer value of the position where a parsing problem starts.
75 * If no problem exists -1 is returned.
77 * @deprecated This method will be removed by a more sophisticated method in future versions,
78 * therefore it is deprecated.<BR>
79 * @see #getHasProblem()
82 public int getProblemStarts();
85 * Returns the integer value of the position where a parsing problem ends.
86 * If no problem exists -1 is returned.
88 * @deprecated This method will be removed by a more sophisticated method in future versions,
89 * therefore it is deprecated. <BR>
90 * @see #getHasProblem()
93 public int getProblemEnds();
96 * @deprecated This method will be removed by a more sophisticated method in future versions,
97 * therefore it is deprecated. <BR>
98 * @see #getProblemStarts()
101 public void setProblemStarts(int start
);
104 * @deprecated This method will be removed by a more sophisticated method in future versions,
105 * therefore it is deprecated. <BR>
106 * @see #getProblemEnds()
109 public void setProblemEnds(int end
);