KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > rdf > arp > ARPErrorNumbers


1 /*
2  * (c) Copyright 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27    $Id: ARPErrorNumbers.java,v 1.17 2005/04/17 18:03:09 jeremy_carroll Exp $
28    AUTHOR: Jeremy J. Carroll
29 */

30 /*
31  * ARPErrorNumbers.java
32  *
33  * Created on July 10, 2001, 8:34 AM
34  */

35
36 package com.hp.hpl.jena.rdf.arp;
37
38 /**
39  * Error numbers used by ARP.
40  * @author jjc
41  */

42 public interface ARPErrorNumbers {
43     /** Used as ErrorMode to not report an error.
44      * @see ARP#setErrorMode
45      *
46      *
47      */

48     public int EM_IGNORE = 0;
49     /** Used as ErrorMode to report warning and continue processing.
50      * @see ARP#setErrorMode
51      */

52     public int EM_WARNING = 1;
53     /** Used as ErrorMode to abort processing of element, after reporting error.
54      * @see ARP#setErrorMode
55      */

56     public int EM_ERROR = 2;
57     /** Used as ErrorMode to stop processing after reporting error.
58      * @see ARP#setErrorMode
59      */

60     public int EM_FATAL = 3;
61
62     // All error numbers must be between 1 and 399.
63
// Divide by 100 to get class.
64
/**
65      An xml:lang attribute uses one or more of the extension
66      facilities in RFC3066 or ISO639.
67      *In some way, the langauge specified is non-standard.
68      *
69      *In both default and strict modes this is ignored; a conservative application
70      *in verbose mode may wish to raise a warning.
71      * (W001)
72      *@see com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_PRIVATE_USE
73      *@see com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_LOCAL_USE
74      *@see com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_EXTRA
75      */

76
77     public int IGN_PRIVATE_XMLLANG = 1;
78
79     /**
80      Indicates that somewhere, other than in an XML Literal
81      an xml:base attribute has been used.
82      This is ignored in default and strict mode. (W002)
83      @see #IGN_XMLBASE_SIGNIFICANT
84      */

85     public int IGN_XMLBASE_USED = 2;
86     /**
87      Indicates that somewhere,
88      an xml:base attribute has been used and
89      changes the interpretation of some URI (either through a
90      URI-reference or idSymbold production in the grammar). (W003)
91      This is ignored in default and strict mode.
92      @see #IGN_XMLBASE_USED
93      */

94     public int IGN_XMLBASE_SIGNIFICANT = 3;
95     /**
96      The use of rdf:parseType="daml:collection" does
97      not conform with RDF2003. (W004)
98      This is ignored in default mode and an error in strict mode.
99      Note: strictly speaking the conformant behaviour is to silently
100      treat this as rdf:parseType="Literal".
101    */

102     public int IGN_DAML_COLLECTION = 4;
103     
104     /**
105      Indicates that no name is known for the current file being parsed..
106      * (W005)
107      */

108
109     public int IGN_NO_BASE_URI_SPECIFIED = 5;
110
111
112     /**
113      
114      * (W100)
115      * @deprecated {@link #IGN_NO_BASE_URI_SPECIFIED}
116      */

117
118     public int WARN_XMLBASE_MISSING = 100;
119     /**
120      A standard rdf attribute like type or about is used
121      without a namespace qualifier. In default and strict mode ARP adds the
122      *rdf: qualifier and reports a warning. (W101).
123     */

124     public int WARN_UNQUALIFIED_RDF_ATTRIBUTE = 101;
125     /**
126      *Some attribute that is not an RDF keyword is used in an
127        unqualified fashion. In default mode, then the namespace of
128        the enclosing element
129        is used.
130        Strict mode skips to the end of the enclosing element. (W102).
131     
132      *
133      */

134     public int WARN_UNQUALIFIED_ATTRIBUTE = 102;
135     /**
136     An attribute name in the RDF namespace has been
137      used that is not a reserved RDF attribute name.
138      *In default and strict modes, a statement is generated with the given name as property.
139      * In default and strict modes this is a warning. (W103).
140      **/

141     public int WARN_UNKNOWN_RDF_ATTRIBUTE = 103;
142     /**
143     An element tag is not a qualified name.
144      In default mode, a resource or property is generated with a malformed URI.
145      * Strict mode skips to the end of the enclosing element. (W104).
146     */

147     public int WARN_UNQUALIFIED_ELEMENT = 104;
148
149     /**
150      *The same name has been used for more than one rdf:ID or rdf:bagID,
151      * in the context of the same xml:base (if any).
152       The default mode allows this with a warning.
153      Strict mode skips to the end of the enclosing element of the second
154      and subsequent occurrences.
155      This check is expensive in memory. When processing very large files,
156      it may be sensible to switch the check off by using
157      {@link ARP#setErrorMode(int,int)} to ignore this condition.
158      * (W105).
159      @see #WARN_LEGAL_REUSE_OF_ID
160     
161      */

162
163     public int WARN_REDEFINITION_OF_ID = 105;
164     /**
165      An unrecognised value for rdf:parseType has been found.
166      In strict mode, this error is ignored, and it is treated
167      as rdf:parseType="Literal", in default mode a warning is issued.
168      * (W106)
169     */

170     public int WARN_UNKNOWN_PARSETYPE = 106;
171     /**
172      *A URI reference does not conform to RFC2396.
173        Use Exception.getMessage() for details.
174        In default mode, the malformed URI is passed to the RDF
175        processing application; strict mode skips to the end of the enclosing element.
176      * (W107)
177     
178      *
179      */

180     public int WARN_MALFORMED_URI = 107;
181     /**
182      *An ID symbol or other grammar production that should be an
183        XML name is malformed. In default mode,
184       the malformed string is passed to the RDF application. (W108)
185      *Strict mode skips to the end of the enclosing element.
186      *
187      */

188     public int WARN_BAD_NAME = 108;
189     /**
190      *A namespace, which has been declared with a relative URI,
191        has been used in a qualified name.
192       Such relative URI namespaces have been
193        <a HREF="http://www.w3.org/2000/09/xppa">deprecated</a>.
194        In default mode, the relative string is passed to the RDF application.
195        Strict mode skips to the end of each enclosing element in which
196        the namespace is used.
197       (Note: this does not necessarily ignore the whole element in
198        which the namespace was declared.) (W109)
199      *
200      */

201     public int WARN_RELATIVE_NAMESPACE_URI_DEPRECATED = 109;
202     /* *
203      *An rdf:aboutEach refers to a collection that either has not been defined in the file, or has been defined but is empty.
204       In strict mode, this is ignored.(W110)
205      *
206      */

207     // public int WARN_EMPTY_ABOUT_EACH =110;
208
/**
209      *Just a double check that an error is reported
210       when XML parsing fails for any reason. In strict mode this is ignored.
211      *(W111)
212      * @deprecated
213     
214      */

215
216     public int WARN_BAD_XML = 111;
217     /**
218      *
219      *Should not happen. But ARP has probably processed the file
220       correctly even if it does. Please
221       report any occurrences to jjc@hpl.hp.com, preferably with a test case.
222      *(W112)
223      */

224     public int WARN_MINOR_INTERNAL_ERROR = 112;
225     /**
226      *An element is tagged rdf:XXX where XXX is not a recognised RDF element name.
227      *The typed node or property element construction is matched.
228      *In both default and strict modes this is a warning. (W113).
229      */

230     public int WARN_UNKNOWN_RDF_ELEMENT = 113;
231     /**
232      * rdf:_NNN is being used in the typed node construction.
233      *
234      * In default mode this is a warning; in strict mode it is ignored.(W114)
235      */

236     public int WARN_RDF_NN_AS_TYPE = 114;
237     /**
238      * The value of an xml:lang attribute does not conform to the
239        syntactic rules of RFC3066.
240        In default mode this is a warning, in strict mode an error. (W115)
241      */

242     public int WARN_MALFORMED_XMLLANG = 115;
243     /**
244      * The value of an xml:lang attribute while syntactically conforming
245        to RFC3066 does not conform with other rules, possibly through not
246        being listed in ISO639 or ISO3166 or the IANA language tag
247        registry. The databases used of these registries was a snapshot of
248       July 24, 2001. If you are using language tags that postdate this snapshot,
249       you should ignore this condition.
250      *The use of a three letter tag instead of a two letter tag or use of
251       the language tag "und" is also reported under this condition, see RFC3066.
252      *
253        In default mode this is a warning, in strict mode an error. (W116)
254      */

255     public int WARN_BAD_XMLLANG = 116;
256     /**
257      * The value of an xml:lang attribute has been deprecated by IANA (W117).
258      *In strict and default mode this is a warning.
259      */

260     public int WARN_DEPRECATED_XMLLANG = 117;
261     /**
262      * An attribute from the xml namespace has been used that is not
263        recognised. (W118).
264      * In default mode this is a warning; in strict mode it is ignored.
265      */

266     public int WARN_UNKNOWN_XML_ATTRIBUTE = 118;
267     /**
268      * An XML processing instruction occurred in RDF content.
269      * Such instructions are ignored, and are usually in error. (W119).
270      * In default mode this is a warning; in strict mode it is ignored.
271      */

272     public int WARN_PROCESSING_INSTRUCTION_IN_RDF = 119;
273     /**
274      * The same name has been used for more than one rdf:ID or rdf:bagID,
275      * in the context of different xml:bases.
276      * In default mode this is a warning; in strict mode it is ignored.
277      @see #WARN_REDEFINITION_OF_ID
278      @deprecated Last supported in Jena 2.1 - too expensive.
279      */

280     public int WARN_LEGAL_REUSE_OF_ID = 120;
281     /**
282       * String Literals in RDF should not start with a composing char,
283       * as defined by the CharacterModel working draft.
284       * This is particularly important if XML 1.1 compatibility is
285       * required.
286       * This is a warning in both default and strict modes (W121).
287       **/

288     public int WARN_STRING_COMPOSING_CHAR = 121;
289     /**
290       * The idSymbol production matched a string with a colon in it.
291       * This is, at best, unwise.
292       * This is a warning in default and an errror in strict mode (W122).
293       *
294       * @deprecated Superceded by the more general {@link #WARN_BAD_NAME} */

295     public int WARN_QNAME_AS_ID = 122;
296
297     /**
298       * URI components in RDF should not start with a composing char,
299       * as defined by the CharacterModel working draft.
300       * ARP checks components that are the value of <code>rdf:about</code>
301       * attributes etc.
302       * This is particularly important if XML 1.1 compatibility is
303       * required.
304       * This is a warning in default mode and ignored in strict mode (W123).
305       *
306      * @deprecated WG decision on <a HREF=
307      *
308 "http://www.w3.org/2001/sw/RDFCore/20030123-issues/#williams-01"
309       >williams-01</a>.
310       **/

311     public int WARN_URI_COMPOSING_CHAR = 123;
312
313     /**
314       * Some xmlns declaration has a non-URI as its right hand side.
315       * This currently permits non-ASCII characters, awaiting clarification from
316       * the namespace editor. This is a warning in default mode and an error in
317       * strict mode (W124). */

318     public int WARN_BAD_NAMESPACE_URI = 124;
319     /**
320      * This is an internal only field, not intended for public use.
321      * In particular, specifically setting the error mode for this
322      * error should be avoided.
323      * Errors with this error code cannot happen. (W125)
324      * When this warning is treated as an error, the non-RDF compliant
325      * daml:collection production is surpressed.
326      **/

327     public int WARN_IN_STRICT_MODE = 125;
328
329     /**
330     * The SAX Parser generated a warning. Treated as a warning in both default
331     * and strict modes. (W126)
332     */

333     public int WARN_SAX_WARNING = 126;
334     
335     /**
336      * Within RDF, it is not permitted to define an
337      * XML namespace that has a namespace URI with the
338      * RDF namespace URI as a proper prefix. (W127).
339      * A warning in default mode, an error in strict mode.
340      */

341     public int WARN_BAD_RDF_NAMESPACE_URI = 127;
342
343     /**
344      * Within RDF, it is not permitted to define an
345      * XML namespace that has a namespace URI with the XML
346      * namespace URI as a proper prefix. (W128). A warning in default mode,an
347      * error in strict mode.
348      */

349     public int WARN_BAD_XML_NAMESPACE_URI = 128;
350     
351     /**
352      * ARP was called with an InputSteamReader or a FileReader which used
353      * an encoding differnt from that in the XML declaration. The usual fix
354      * is to use an InputStream or a FileInputStream instead. (W129).
355      * A warning in default mode, an error in strict mode.
356      * @see #ERR_ENCODING_MISMATCH
357      */

358     public int WARN_ENCODING_MISMATCH = 129;
359     /**
360      * A base URI was required but "" was given. The
361      * RDF/XML input includes a relative URI, an rdf:ID or
362      * some other same document reference. (W130).
363      */

364     public int WARN_RESOLVING_URI_AGAINST_EMPTY_BASE = 130;
365
366     /**
367         * String Literals in RDF should be in Unicode Normal Form C
368         *
369         * * (W131).
370         **/

371        public int WARN_STRING_NOT_NORMAL_FORM_C = 131;
372        
373        /**
374         * The character encoding in the XML declaration is not
375         * fully supported. In particular, advice about
376         * the IANA registry entry, if any, is not available.
377         * This warning is only believed to be applicable to
378         * Java 1.4. Java 1.5 has more extensive support for
379         * this information, and so upgrading from Java 1.4 to Java 1.5
380         * is a plausible response to this warning.
381         * (W132).
382         */

383        public int WARN_UNSUPPORTED_ENCODING = 132;
384
385        /**
386         * The character encoding in the XML declaration is not
387         * registered with IANA. Hence the RDF/XML file
388         * is not appropriate for use on the Web, but only
389         * for private interactions, between parties agreeing
390         * on the character encoding.
391         * It may not be possible to read this file with superficially
392         * similar Jena installations, let alone with other RDF systems.
393         * (W133).
394         */

395        public int WARN_NON_IANA_ENCODING = 133;
396
397        /**
398         * The encoding in the XML declaration is an alias
399         * registered with IANA. Better interoperability
400         * is likely by replacing the encoding declaration
401         * with the canonical IANA name, provided in the warning
402         * message.
403         * (W134).
404         */

405        public int WARN_NONCANONICAL_IANA_NAME =134;
406     
407     /** Should not happen.
408         Please report occurrence to jjc@hpl.hp.com with test case, if possible.
409      (E200)
410     
411      */

412     public int ERR_INTERNAL_ERROR = 200;
413     /** The attributes or element tags contravene the RDF grammar.
414      (XML syntax errors are not reported with this mechanism,
415      but as {@link org.xml.sax.SAXParseException SAXParseException}'s).
416      The detailed error message indicates the nature of the contravention.
417      (E201)
418      */

419     public int ERR_SYNTAX_ERROR = 201;
420     /** Non-white character data has occurred where the RDF grammar
421      does not permit it. This is a special case of ERR_SYNTAX_ERROR,
422      which is detected differently.
423     (E202)
424      */

425     public int ERR_NOT_WHITESPACE = 202;
426     /** rdf:aboutEach may only occur in a top-level obj expansion,
427      * either an rdf:Description or a typed node. This is a special
428      * case of ERR_SYNTAX_ERROR, which is detected differently. (E203).
429      * @deprecated No longer occurs. Any use of rdf:aboutEach is a syntax error.
430      *
431      */

432
433     public int ERR_ABOUTEACH_NOT_TOPLEVEL = 203;
434     /**
435      * rdf:li is being used in the typed node construction.
436      * (E204)
437      */

438     public int ERR_LI_AS_TYPE = 204;
439     /**
440      *An element is tagged rdf:XXX where XXX is an RDF attribute name,
441      * (E205).
442      */

443     public int ERR_BAD_RDF_ELEMENT = 205;
444     /**
445     An attribute name in the RDF namespace has been
446      used that is reserved as an RDF name, but not as an attribute.
447      These are rdf:Description, rdf:aboutEach, rdf:aboutEachPrefix.
448      The latter two are deprecated. (E206).
449      **/

450     public int ERR_BAD_RDF_ATTRIBUTE = 206;
451     /**
452      * String Literals in RDF must be in Unicode Normal Form C
453      @deprecated See 2nd Last Call docs
454      *
455      * * (E207).
456      **/

457     public int ERR_STRING_NOT_NORMAL_FORM_C = 207;
458     /**
459      * URI references in RDF must be in Unicode Normal Form C
460      * (E208).
461      * @deprecated WG decision on <a HREF=
462      *
463 "http://www.w3.org/2001/sw/RDFCore/20030123-issues/#williams-01"
464       >williams-01</a>.
465    */

466     public int ERR_URI_NOT_NORMAL_FORM_C = 208;
467     /**
468     * The SAX Parser generated an error.
469     * Treated as an error in both default and strict modes. (E209)
470     */

471     public int ERR_SAX_ERROR = 209;
472     
473
474     /**
475      * ARP was called with an InputSteamReader or a FileReader which used
476      * an encoding differnt from that in the XML declaration. Moreover, this
477      * was detected as probably significant (i.e. the document includes
478      * characters outside the ascii range). The usual fix is to use an
479      * InputStream or a FileInputStream instead. (E210).
480      * @see #WARN_ENCODING_MISMATCH
481      */

482     public int ERR_ENCODING_MISMATCH = 210;
483     
484     /**
485      * A base URI was required but not given. The
486      * RDF/XML input includes a relative URI, an rdf:ID or
487      * some other same document reference. (E211).
488      */

489     public int ERR_RESOLVING_URI_AGAINST_NULL_BASE = 211;
490     /**
491      * The document claimed to be UTF-8 but was not.
492      * It probably needs an xml declaration with
493      * an encoding attribute. (E212).
494      */

495     public int ERR_UTF_ENCODING = 212;/**
496      * An IOException occurred. (E213).
497      */

498     public int ERR_GENERIC_IO = 213;
499    /** The error recovery code failed; this can occur. (E300)
500     **/

501     public int ERR_UNABLE_TO_RECOVER = 300;
502
503     /** The SAX Parser generated a fatal error.
504      * Resetting this mode is not supported.
505      * Treated as a fatal error in both
506      * default and strict modes. (E301) */

507     public int ERR_SAX_FATAL_ERROR = 301;
508
509 }
510
Popular Tags