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.
10 package eu
.etaxonomy
.cdm
.model
.common
;
12 import java
.util
.List
;
14 import eu
.etaxonomy
.cdm
.strategy
.parser
.ParserProblem
;
22 public interface IParsable
{
25 * Returns an integer value indicating whether the used parser
26 * method was able to parse a string successfully into this object (<code>0</code>)
27 * or not (<code>!=0</code>). The the parsing was not successful the value returned
28 * defines in more detail what the problem was. The definition of these values depends
29 * on the parser that has been used for parsing.
31 * @return the int value parsingProblem
33 public int getParsingProblem();
36 * @see #getParsingProblem()
38 public void setParsingProblem(int hasProblem
);
41 * Returns true if any parsing problem (warning or error) exists.
43 * @see #getHasProblem()
45 public boolean hasProblem();
48 * Returns true, if the specified problem exists. False otherwise.
52 public boolean hasProblem(ParserProblem problem
);
56 * Returns a list of all warnings and errors that have been recognized during the parsing
57 * and not yet handled.
60 public List
<ParserProblem
> getParsingProblems();
63 * Adds a parsing problem to the list of parsing problems
66 public void addParsingProblem(ParserProblem problem
);
69 * Removes a parsing problem from the list of parsing problems.
70 * If the problem is not in the list or is <code>null</code>, nothing happens.
72 */public void removeParsingProblem(ParserProblem problem
);
76 * Returns the integer value of the position where a parsing problem starts.
77 * If no problem exists -1 is returned.
79 * @deprecated This method will be removed by a more sophisticated method in future versions,
80 * therefore it is deprecated.<BR>
81 * @see #getHasProblem()
84 public int getProblemStarts();
87 * Returns the integer value of the position where a parsing problem ends.
88 * If no problem exists -1 is returned.
90 * @deprecated This method will be removed by a more sophisticated method in future versions,
91 * therefore it is deprecated. <BR>
92 * @see #getHasProblem()
95 public int getProblemEnds();
98 * @deprecated This method will be removed by a more sophisticated method in future versions,
99 * therefore it is deprecated. <BR>
100 * @see #getProblemStarts()
103 public void setProblemStarts(int start
);
106 * @deprecated This method will be removed by a more sophisticated method in future versions,
107 * therefore it is deprecated. <BR>
108 * @see #getProblemEnds()
111 public void setProblemEnds(int end
);