KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > impl > Constants


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2000-2003 The Apache Software Foundation. All rights
6  * reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Xerces" and "Apache Software Foundation" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache",
33  * nor may "Apache" appear in their name, without prior written
34  * permission of the Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of the Apache Software Foundation and was
52  * originally based on software copyright (c) 1999, International
53  * Business Machines, Inc., http://www.apache.org. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  */

57
58 package com.sun.org.apache.xerces.internal.impl;
59
60 import java.util.Enumeration JavaDoc;
61 import java.util.NoSuchElementException JavaDoc;
62
63 /**
64  * Commonly used constants.
65  *
66  * @author Andy Clark, IBM
67  *
68  * @version $Id: Constants.java,v 1.42 2004/04/25 02:08:53 mrglavas Exp $
69  */

70 public final class Constants {
71
72     //
73
// Constants
74
//
75
// Schema Types:
76
public static final String JavaDoc NS_XMLSCHEMA = "http://www.w3.org/2001/XMLSchema".intern();
77     public static final String JavaDoc NS_DTD = "http://www.w3.org/TR/REC-xml".intern();
78
79     // sax features
80

81     /** SAX feature prefix ("http://xml.org/sax/features/"). */
82     public static final String JavaDoc SAX_FEATURE_PREFIX = "http://xml.org/sax/features/";
83
84
85     /** Namespaces feature ("namespaces"). */
86     public static final String JavaDoc NAMESPACES_FEATURE = "namespaces";
87
88     /** Namespace prefixes feature ("namespace-prefixes"). */
89     public static final String JavaDoc NAMESPACE_PREFIXES_FEATURE = "namespace-prefixes";
90
91     /** String interning feature ("string-interning"). */
92     public static final String JavaDoc STRING_INTERNING_FEATURE = "string-interning";
93
94     /** Validation feature ("validation"). */
95     public static final String JavaDoc VALIDATION_FEATURE = "validation";
96
97     /** External general entities feature ("external-general-entities "). */
98     public static final String JavaDoc EXTERNAL_GENERAL_ENTITIES_FEATURE = "external-general-entities";
99
100     /** External parameter entities feature ("external-parameter-entities "). */
101     public static final String JavaDoc EXTERNAL_PARAMETER_ENTITIES_FEATURE = "external-parameter-entities";
102     
103     /** Lexical handler parameter entities feature ("lexical-handler/parameter-entities"). */
104     public static final String JavaDoc LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE = "lexical-handler/parameter-entities";
105     
106     /** Is standalone feature ("is-standalone"). */
107     public static final String JavaDoc IS_STANDALONE_FEATURE = "is-standalone";
108     
109     /** Resolve DTD URIs feature ("resolve-dtd-uris"). */
110     public static final String JavaDoc RESOLVE_DTD_URIS_FEATURE = "resolve-dtd-uris";
111     
112     /** Use Attributes2 feature ("use-attributes2"). */
113     public static final String JavaDoc USE_ATTRIBUTES2_FEATURE = "use-attributes2";
114     
115     /** Use Locator2 feature ("use-locator2"). */
116     public static final String JavaDoc USE_LOCATOR2_FEATURE = "use-locator2";
117     
118     /** Use EntityResolver2 feature ("use-entity-resolver2"). */
119     public static final String JavaDoc USE_ENTITY_RESOLVER2_FEATURE = "use-entity-resolver2";
120     
121     /** Unicode normalization checking feature ("unicode-normalization-checking"). */
122     public static final String JavaDoc UNICODE_NORMALIZATION_CHECKING_FEATURE = "unicode-normalization-checking";
123     
124     /** xmlns URIs feature ("xmlns-uris"). */
125     public static final String JavaDoc XMLNS_URIS_FEATURE = "xmlns-uris";
126     
127     /** XML 1.1 feature ("xml-1.1"). */
128     public static final String JavaDoc XML_11_FEATURE = "xml-1.1";
129
130     /** Allow unparsed entity and notation declaration events to be sent after the end DTD event ("allow-dtd-events-after-endDTD") */
131     public static final String JavaDoc ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE = "allow-dtd-events-after-endDTD";
132
133     // sax properties
134

135     /** SAX property prefix ("http://xml.org/sax/properties/"). */
136     public static final String JavaDoc SAX_PROPERTY_PREFIX = "http://xml.org/sax/properties/";
137
138     /** Declaration handler property ("declaration-handler"). */
139     public static final String JavaDoc DECLARATION_HANDLER_PROPERTY = "declaration-handler";
140
141     /** Lexical handler property ("lexical-handler"). */
142     public static final String JavaDoc LEXICAL_HANDLER_PROPERTY = "lexical-handler";
143
144     /** DOM node property ("dom-node"). */
145     public static final String JavaDoc DOM_NODE_PROPERTY = "dom-node";
146
147     /** XML string property ("xml-string"). */
148     public static final String JavaDoc XML_STRING_PROPERTY = "xml-string";
149     
150     public static final String JavaDoc FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
151     
152     /** Document XML version property ("document-xml-version"). */
153     public static final String JavaDoc DOCUMENT_XML_VERSION_PROPERTY = "document-xml-version";
154
155
156     //
157
// JAXP properties
158
//
159

160     /** JAXP property prefix ("http://java.sun.com/xml/jaxp/properties/"). */
161     public static final String JavaDoc JAXP_PROPERTY_PREFIX =
162             "http://java.sun.com/xml/jaxp/properties/";
163
164     /** JAXP schemaSource property: when used internally may include DTD sources (DOM) */
165     public static final String JavaDoc SCHEMA_SOURCE = "schemaSource";
166
167     /** JAXP schemaSource language: when used internally may include DTD namespace (DOM) */
168     public static final String JavaDoc SCHEMA_LANGUAGE = "schemaLanguage";
169
170     public static final String JavaDoc SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ;
171
172     //
173
// DOM features
174
//
175

176     /** Comments feature ("include-comments"). */
177     public static final String JavaDoc INCLUDE_COMMENTS_FEATURE = "include-comments";
178
179     /** Create cdata nodes feature ("create-cdata-nodes"). */
180     public static final String JavaDoc CREATE_CDATA_NODES_FEATURE = "create-cdata-nodes";
181
182     /** Feature id: load as infoset. */
183     public static final String JavaDoc LOAD_AS_INFOSET = "load-as-infoset";
184
185
186     //
187
// Constants: DOM Level 3 feature ids
188
//
189

190     public static final String JavaDoc DOM_CANONICAL_FORM = "canonical-form";
191     public static final String JavaDoc DOM_CDATA_SECTIONS ="cdata-sections";
192     public static final String JavaDoc DOM_COMMENTS = "comments";
193
194     // REVISIT: this feature seems to have no effect for Xerces
195
public static final String JavaDoc DOM_CHARSET_OVERRIDES_XML_ENCODING =
196     "charset-overrides-xml-encoding";
197
198     public static final String JavaDoc DOM_DATATYPE_NORMALIZATION = "datatype-normalization";
199     public static final String JavaDoc DOM_ENTITIES = "entities";
200     public static final String JavaDoc DOM_INFOSET = "infoset";
201     public static final String JavaDoc DOM_NAMESPACES = "namespaces";
202     public static final String JavaDoc DOM_NAMESPACE_DECLARATIONS = "namespace-declarations";
203     public static final String JavaDoc DOM_SUPPORTED_MEDIATYPES_ONLY =
204     "supported-media-types-only";
205
206     public static final String JavaDoc DOM_VALIDATE_IF_SCHEMA = "validate-if-schema";
207     public static final String JavaDoc DOM_VALIDATE = "validate";
208     public static final String JavaDoc DOM_ELEMENT_CONTENT_WHITESPACE =
209     "element-content-whitespace";
210
211     // DOM Level 3 features defined in Core:
212
public static final String JavaDoc DOM_DISCARD_DEFAULT_CONTENT = "discard-default-content";
213     public static final String JavaDoc DOM_NORMALIZE_CHARACTERS = "normalize-characters";
214     public static final String JavaDoc DOM_CHECK_CHAR_NORMALIZATION = "check-character-normalization";
215     public static final String JavaDoc DOM_WELLFORMED = "well-formed";
216     public static final String JavaDoc DOM_SPLIT_CDATA = "split-cdata-sections";
217
218     // Load and Save
219
public static final String JavaDoc DOM_FORMAT_PRETTY_PRINT = "format-pretty-print";
220     public static final String JavaDoc DOM_XMLDECL = "xml-declaration";
221     public static final String JavaDoc DOM_UNKNOWNCHARS = "unknown-characters";
222     public static final String JavaDoc DOM_CERTIFIED = "certified";
223     public static final String JavaDoc DOM_DISALLOW_DOCTYPE = "disallow-doctype";
224     public static final String JavaDoc DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS = "ignore-unknown-character-denormalizations";
225    
226     // DOM Properties
227
public static final String JavaDoc DOM_RESOURCE_RESOLVER = "resource-resolver";
228     public static final String JavaDoc DOM_ERROR_HANDLER = "error-handler";
229     public static final String JavaDoc DOM_SCHEMA_TYPE = "schema-type";
230     public static final String JavaDoc DOM_SCHEMA_LOCATION = "schema-location";
231
232     // XSModel
233
public static final String JavaDoc DOM_PSVI = "psvi";
234
235
236     // xerces features
237

238     /** Xerces features prefix ("http://apache.org/xml/features/"). */
239     public static final String JavaDoc XERCES_FEATURE_PREFIX = "http://apache.org/xml/features/";
240
241     /** Schema validation feature ("validation/schema"). */
242     public static final String JavaDoc SCHEMA_VALIDATION_FEATURE = "validation/schema";
243
244     /** Expose schema normalized values */
245     public static final String JavaDoc SCHEMA_NORMALIZED_VALUE = "validation/schema/normalized-value";
246
247     /** Send schema default value via characters() */
248     public static final String JavaDoc SCHEMA_ELEMENT_DEFAULT = "validation/schema/element-default";
249
250     /** Schema full constraint checking ("validation/schema-full-checking"). */
251     public static final String JavaDoc SCHEMA_FULL_CHECKING = "validation/schema-full-checking";
252
253     /** Augment Post-Schema-Validation-Infoset */
254     public static final String JavaDoc SCHEMA_AUGMENT_PSVI = "validation/schema/augment-psvi";
255
256     /** Dynamic validation feature ("validation/dynamic"). */
257     public static final String JavaDoc DYNAMIC_VALIDATION_FEATURE = "validation/dynamic";
258
259     /** Warn on duplicate attribute declaration feature ("validation/warn-on-duplicate-attdef"). */
260     public static final String JavaDoc WARN_ON_DUPLICATE_ATTDEF_FEATURE = "validation/warn-on-duplicate-attdef";
261
262     /** Warn on undeclared element feature ("validation/warn-on-undeclared-elemdef"). */
263     public static final String JavaDoc WARN_ON_UNDECLARED_ELEMDEF_FEATURE = "validation/warn-on-undeclared-elemdef";
264
265     /** Warn on duplicate entity declaration feature ("warn-on-duplicate-entitydef"). */
266     public static final String JavaDoc WARN_ON_DUPLICATE_ENTITYDEF_FEATURE = "warn-on-duplicate-entitydef";
267
268     /** Allow Java encoding names feature ("allow-java-encodings"). */
269     public static final String JavaDoc ALLOW_JAVA_ENCODINGS_FEATURE = "allow-java-encodings";
270
271     /** Disallow DOCTYPE declaration feature ("disallow-doctype-decl"). */
272     public static final String JavaDoc DISALLOW_DOCTYPE_DECL_FEATURE = "disallow-doctype-decl";
273
274     /** Continue after fatal error feature ("continue-after-fatal-error"). */
275     public static final String JavaDoc CONTINUE_AFTER_FATAL_ERROR_FEATURE = "continue-after-fatal-error";
276
277     /** Load dtd grammar when nonvalidating feature ("nonvalidating/load-dtd-grammar"). */
278     public static final String JavaDoc LOAD_DTD_GRAMMAR_FEATURE = "nonvalidating/load-dtd-grammar";
279
280     /** Load external dtd when nonvalidating feature ("nonvalidating/load-external-dtd"). */
281     public static final String JavaDoc LOAD_EXTERNAL_DTD_FEATURE = "nonvalidating/load-external-dtd";
282
283     /** Defer node expansion feature ("dom/defer-node-expansion"). */
284     public static final String JavaDoc DEFER_NODE_EXPANSION_FEATURE = "dom/defer-node-expansion";
285
286     /** Create entity reference nodes feature ("dom/create-entity-ref-nodes"). */
287     public static final String JavaDoc CREATE_ENTITY_REF_NODES_FEATURE = "dom/create-entity-ref-nodes";
288
289     /** Include ignorable whitespace feature ("dom/include-ignorable-whitespace"). */
290     public static final String JavaDoc INCLUDE_IGNORABLE_WHITESPACE = "dom/include-ignorable-whitespace";
291
292     /** Default attribute values feature ("validation/default-attribute-values"). */
293     public static final String JavaDoc DEFAULT_ATTRIBUTE_VALUES_FEATURE = "validation/default-attribute-values";
294
295     /** Validate content models feature ("validation/validate-content-models"). */
296     public static final String JavaDoc VALIDATE_CONTENT_MODELS_FEATURE = "validation/validate-content-models";
297
298     /** Validate datatypes feature ("validation/validate-datatypes"). */
299     public static final String JavaDoc VALIDATE_DATATYPES_FEATURE = "validation/validate-datatypes";
300
301     /** Notify character references feature (scanner/notify-char-refs"). */
302     public static final String JavaDoc NOTIFY_CHAR_REFS_FEATURE = "scanner/notify-char-refs";
303
304     /** Notify built-in (&amp;amp;, etc.) references feature (scanner/notify-builtin-refs"). */
305     public static final String JavaDoc NOTIFY_BUILTIN_REFS_FEATURE = "scanner/notify-builtin-refs";
306
307     /** Standard URI conformant feature ("standard-uri-conformant"). */
308     public static final String JavaDoc STANDARD_URI_CONFORMANT_FEATURE = "standard-uri-conformant";
309     
310     /** Internal performance related feature:
311      * false - the parser settings (features/properties) have not changed between 2 parses
312      * true - the parser settings have changed between 2 parses
313      * NOTE: this feature should only be set by the parser configuration.
314      */

315     public static final String JavaDoc PARSER_SETTINGS = "internal/parser-settings";
316
317     /** Feature to make XML Processor XInclude Aware */
318     public static final String JavaDoc XINCLUDE_AWARE = "xinclude-aware";
319
320     /** Ignore xsi:schemaLocation and xsi:noNamespaceSchemaLocation. */
321     public static final String JavaDoc IGNORE_SCHEMA_LOCATION_HINTS = "validation/schema/ignore-schema-location-hints";
322     
323     /**
324      * When true, the schema processor will change characters events
325      * to ignorableWhitespaces events, when characters are expected to
326      * only contain ignorable whitespaces.
327      */

328     public static final String JavaDoc CHANGE_IGNORABLE_CHARACTERS_INTO_IGNORABLE_WHITESPACES =
329         "validation/change-ignorable-characters-into-ignorable-whitespaces";
330     
331     // xerces properties
332

333     /** Xerces properties prefix ("http://apache.org/xml/properties/"). */
334     public static final String JavaDoc XERCES_PROPERTY_PREFIX = "http://apache.org/xml/properties/";
335
336     /** Current element node property ("dom/current-element-node"). */
337     public static final String JavaDoc CURRENT_ELEMENT_NODE_PROPERTY = "dom/current-element-node";
338
339     /** Document class name property ("dom/document-class-name"). */
340     public static final String JavaDoc DOCUMENT_CLASS_NAME_PROPERTY = "dom/document-class-name";
341
342     /** Symbol table property ("internal/symbol-table"). */
343     public static final String JavaDoc SYMBOL_TABLE_PROPERTY = "internal/symbol-table";
344
345     /** Error reporter property ("internal/error-reporter"). */
346     public static final String JavaDoc ERROR_REPORTER_PROPERTY = "internal/error-reporter";
347
348     /** Error handler property ("internal/error-handler"). */
349     public static final String JavaDoc ERROR_HANDLER_PROPERTY = "internal/error-handler";
350
351     /** XInclude handler property ("internal/xinclude-handler"). */
352     public static final String JavaDoc XINCLUDE_HANDLER_PROPERTY = "internal/xinclude-handler";
353
354     /** Entity manager property ("internal/entity-manager"). */
355     public static final String JavaDoc ENTITY_MANAGER_PROPERTY = "internal/entity-manager";
356
357     /** Input buffer size property ("input-buffer-size"). */
358     public static final String JavaDoc BUFFER_SIZE_PROPERTY = "input-buffer-size";
359
360     /** Security manager property ("security-manager"). */
361     public static final String JavaDoc SECURITY_MANAGER_PROPERTY = "security-manager";
362
363     /** property identifier: security manager. */
364     protected static final String JavaDoc SECURITY_MANAGER =
365         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
366     
367     /** Entity resolver property ("internal/entity-resolver"). */
368     public static final String JavaDoc ENTITY_RESOLVER_PROPERTY = "internal/entity-resolver";
369
370     /** Grammar pool property ("internal/grammar-pool"). */
371     public static final String JavaDoc XMLGRAMMAR_POOL_PROPERTY = "internal/grammar-pool";
372
373     /** Datatype validator factory ("internal/datatype-validator-factory"). */
374     public static final String JavaDoc DATATYPE_VALIDATOR_FACTORY_PROPERTY = "internal/datatype-validator-factory";
375
376     /** Document scanner property ("internal/document-scanner"). */
377     public static final String JavaDoc DOCUMENT_SCANNER_PROPERTY = "internal/document-scanner";
378
379     /** DTD scanner property ("internal/dtd-scanner"). */
380     public static final String JavaDoc DTD_SCANNER_PROPERTY = "internal/dtd-scanner";
381
382     /** DTD processor property ("internal/dtd-processor"). */
383     public static final String JavaDoc DTD_PROCESSOR_PROPERTY = "internal/dtd-processor";
384
385     /** Validator property ("internal/validator"). */
386     public static final String JavaDoc VALIDATOR_PROPERTY = "internal/validator";
387
388     /** Validator property ("internal/validator/dtd"). */
389     public static final String JavaDoc DTD_VALIDATOR_PROPERTY = "internal/validator/dtd";
390
391     /** Validator property ("internal/validator/schema"). */
392     public static final String JavaDoc SCHEMA_VALIDATOR_PROPERTY = "internal/validator/schema";
393
394     /** No namespace schema location property ("schema/external-schemaLocation"). */
395     public static final String JavaDoc SCHEMA_LOCATION = "schema/external-schemaLocation";
396
397     /** Schema location property ("schema/external-noNamespaceSchemaLocation"). */
398     public static final String JavaDoc SCHEMA_NONS_LOCATION = "schema/external-noNamespaceSchemaLocation";
399
400     /** Namespace binder property ("internal/namespace-binder"). */
401     public static final String JavaDoc NAMESPACE_BINDER_PROPERTY = "internal/namespace-binder";
402
403     /** Namespace context property ("internal/namespace-context"). */
404     public static final String JavaDoc NAMESPACE_CONTEXT_PROPERTY = "internal/namespace-context";
405
406     /** Validation manager property ("internal/validation-manager"). */
407     public static final String JavaDoc VALIDATION_MANAGER_PROPERTY = "internal/validation-manager";
408
409     /** XPointer Schema property ("xpointer-schema"). */
410     public static final String JavaDoc XPOINTER_SCHEMA_PROPERTY = "xpointer-schema";
411
412     // general constants
413

414     /** Element PSVI is stored in augmentations using string "ELEMENT_PSVI" */
415     public final static String JavaDoc ELEMENT_PSVI = "ELEMENT_PSVI";
416
417     /* Attribute PSVI is stored in augmentations using string "ATTRIBUTE_PSVI" */
418     public final static String JavaDoc ATTRIBUTE_PSVI = "ATTRIBUTE_PSVI";
419         
420     /**
421      * Boolean indicating whether an attribute is declared in the DTD is stored
422      * in augmentations using the string "ATTRIBUTE_DECLARED". The absence of this
423      * augmentation indicates that the attribute was not declared in the DTD.
424      */

425     public final static String JavaDoc ATTRIBUTE_DECLARED = "ATTRIBUTE_DECLARED";
426     
427     public final static String JavaDoc ENTITY_EXPANSION_LIMIT = "entityExpansionLimit";
428     
429     public final static String JavaDoc MAX_OCCUR_LIMIT = "maxOccurLimit";
430
431     /**
432      * {@link org.w3c.dom.TypeInfo} associated with current element/attribute
433      * is stored in augmentations using this string as the key.
434      *
435      * This will ultimately controls {@link com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser}
436      * regarding what object the DOM will return from
437      * {@link org.w3c.dom.Attr#getSchemaTypeInfo()} and
438      * {@link org.w3c.dom.Element#getSchemaTypeInfo()} and
439      */

440     public final static String JavaDoc TYPEINFO = "org.w3c.dom.TypeInfo";
441     
442     /**
443      * Whether an attribute is an id or not is stored in augmentations
444      * using this string as the key. The value is {@link Boolean#TRUE}
445      * or {@link Boolean#FALSE}.
446      *
447      * This will ultimately controls {@link com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser}
448      * about whether it will mark an attribute as ID or not.
449      */

450     public final static String JavaDoc ID_ATTRIBUTE = "ID_ATTRIBUTE";
451     
452     // XML version constants
453

454     /**
455      * Boolean indicating whether an entity referenced in the document has
456      * not been read is stored in augmentations using the string "ENTITY_SKIPPED".
457      * The absence of this augmentation indicates that the entity had a
458      * declaration and was expanded.
459      */

460     public final static String JavaDoc ENTITY_SKIPPED = "ENTITY_SKIPPED";
461     
462     /**
463      * Boolean indicating whether a character is a probable white space
464      * character (ch <= 0x20) that was the replacement text of a character
465      * reference is stored in augmentations using the string "CHAR_REF_PROBABLE_WS".
466      * The absence of this augmentation indicates that the character is not
467      * probable white space and/or was not included from a character reference.
468      */

469     public final static String JavaDoc CHAR_REF_PROBABLE_WS = "CHAR_REF_PROBABLE_WS";
470
471     // XML version constants
472
public final static short XML_VERSION_1_0 = 1;
473     public final static short XML_VERSION_1_1 = 2;
474
475     
476     // DOM related constants
477
public final static String JavaDoc ANONYMOUS_TYPE_NAMESPACE =
478         "http://apache.org/xml/xmlschema/1.0/anonymousTypes";
479     
480     // private
481

482     /** SAX features. */
483     private static final String JavaDoc[] fgSAXFeatures = {
484         NAMESPACES_FEATURE,
485         NAMESPACE_PREFIXES_FEATURE,
486         STRING_INTERNING_FEATURE,
487         VALIDATION_FEATURE,
488         EXTERNAL_GENERAL_ENTITIES_FEATURE,
489         EXTERNAL_PARAMETER_ENTITIES_FEATURE,
490     };
491
492     /** SAX properties. */
493     private static final String JavaDoc[] fgSAXProperties = {
494         DECLARATION_HANDLER_PROPERTY,
495         LEXICAL_HANDLER_PROPERTY,
496         DOM_NODE_PROPERTY,
497         XML_STRING_PROPERTY,
498     };
499
500     /** Xerces features. */
501     private static final String JavaDoc[] fgXercesFeatures = {
502         SCHEMA_VALIDATION_FEATURE,
503         SCHEMA_FULL_CHECKING,
504         DYNAMIC_VALIDATION_FEATURE,
505         WARN_ON_DUPLICATE_ATTDEF_FEATURE,
506         WARN_ON_UNDECLARED_ELEMDEF_FEATURE,
507         ALLOW_JAVA_ENCODINGS_FEATURE,
508         CONTINUE_AFTER_FATAL_ERROR_FEATURE,
509         LOAD_DTD_GRAMMAR_FEATURE,
510         LOAD_EXTERNAL_DTD_FEATURE,
511         //DEFER_NODE_EXPANSION_FEATURE,
512
CREATE_ENTITY_REF_NODES_FEATURE,
513         XINCLUDE_AWARE,
514         INCLUDE_IGNORABLE_WHITESPACE,
515         //GRAMMAR_ACCESS_FEATURE,
516
DEFAULT_ATTRIBUTE_VALUES_FEATURE,
517         VALIDATE_CONTENT_MODELS_FEATURE,
518         VALIDATE_DATATYPES_FEATURE,
519         NOTIFY_CHAR_REFS_FEATURE,
520         NOTIFY_BUILTIN_REFS_FEATURE,
521         DISALLOW_DOCTYPE_DECL_FEATURE,
522         STANDARD_URI_CONFORMANT_FEATURE
523     };
524
525     /** Xerces properties. */
526     private static final String JavaDoc[] fgXercesProperties = {
527         CURRENT_ELEMENT_NODE_PROPERTY,
528         DOCUMENT_CLASS_NAME_PROPERTY,
529         SYMBOL_TABLE_PROPERTY,
530         ERROR_HANDLER_PROPERTY,
531         ERROR_REPORTER_PROPERTY,
532         ENTITY_MANAGER_PROPERTY,
533         ENTITY_RESOLVER_PROPERTY,
534         XMLGRAMMAR_POOL_PROPERTY,
535         DATATYPE_VALIDATOR_FACTORY_PROPERTY,
536         DOCUMENT_SCANNER_PROPERTY,
537         DTD_SCANNER_PROPERTY,
538         VALIDATOR_PROPERTY,
539         SCHEMA_LOCATION,
540         SCHEMA_NONS_LOCATION,
541         VALIDATION_MANAGER_PROPERTY,
542         BUFFER_SIZE_PROPERTY,
543         SECURITY_MANAGER_PROPERTY
544     };
545
546     /** Empty enumeration. */
547     private static final Enumeration JavaDoc fgEmptyEnumeration = new ArrayEnumeration(new Object JavaDoc[] {});
548
549     //
550
// Constructors
551
//
552

553     /** This class cannot be instantiated. */
554     private Constants() {}
555
556     //
557
// Public methods
558
//
559

560     // sax
561

562     /** Returns an enumeration of the SAX features. */
563     public static Enumeration JavaDoc getSAXFeatures() {
564         return fgSAXFeatures.length > 0
565                ? new ArrayEnumeration(fgSAXFeatures) : fgEmptyEnumeration;
566     } // getSAXFeatures():Enumeration
567

568     /** Returns an enumeration of the SAX properties. */
569     public static Enumeration JavaDoc getSAXProperties() {
570         return fgSAXProperties.length > 0
571                ? new ArrayEnumeration(fgSAXProperties) : fgEmptyEnumeration;
572     } // getSAXProperties():Enumeration
573

574     // xerces
575

576     /** Returns an enumeration of the Xerces features. */
577     public static Enumeration JavaDoc getXercesFeatures() {
578         return fgXercesFeatures.length > 0
579                ? new ArrayEnumeration(fgXercesFeatures) : fgEmptyEnumeration;
580     } // getXercesFeatures():Enumeration
581

582     /** Returns an enumeration of the Xerces properties. */
583     public static Enumeration JavaDoc getXercesProperties() {
584         return fgXercesProperties.length > 0
585                ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
586     } // getXercesProperties():Enumeration
587

588     //
589
// Classes
590
//
591

592     /**
593      * An array enumeration.
594      *
595      * @author Andy Clark, IBM
596      */

597     static class ArrayEnumeration
598         implements Enumeration JavaDoc {
599
600         //
601
// Data
602
//
603

604         /** Array. */
605         private Object JavaDoc[] array;
606
607         /** Index. */
608         private int index;
609
610         //
611
// Constructors
612
//
613

614         /** Constructs an array enumeration. */
615         public ArrayEnumeration(Object JavaDoc[] array) {
616             this.array = array;
617         } // <init>(Object[])
618

619         //
620
// Enumeration methods
621
//
622

623         /**
624          * Tests if this enumeration contains more elements.
625          *
626          * @return <code>true</code> if this enumeration contains more elements;
627          * <code>false</code> otherwise.
628          * @since JDK1.0
629          */

630         public boolean hasMoreElements() {
631             return index < array.length;
632         } // hasMoreElement():boolean
633

634         /**
635          * Returns the next element of this enumeration.
636          *
637          * @return the next element of this enumeration.
638          * @exception NoSuchElementException if no more elements exist.
639          * @since JDK1.0
640          */

641         public Object JavaDoc nextElement() {
642             if (index < array.length) {
643                 return array[index++];
644             }
645             throw new NoSuchElementException JavaDoc();
646         } // nextElement():Object
647

648     } // class ArrayEnumeration
649

650     //
651
// MAIN
652
//
653

654     /** Prints all of the constants to standard output. */
655     public static void main(String JavaDoc[] argv) {
656
657         print("SAX features:", SAX_FEATURE_PREFIX, fgSAXFeatures);
658         print("SAX properties:", SAX_PROPERTY_PREFIX, fgSAXProperties);
659         print("Xerces features:", XERCES_FEATURE_PREFIX, fgXercesFeatures);
660         print("Xerces properties:", XERCES_PROPERTY_PREFIX, fgXercesProperties);
661
662     } // main(String[])
663

664     /** Prints a list of features/properties. */
665     private static void print(String JavaDoc header, String JavaDoc prefix, Object JavaDoc[] array) {
666         System.out.print(header);
667         if (array.length > 0) {
668             System.out.println();
669             for (int i = 0; i < array.length; i++) {
670                 System.out.print(" ");
671                 System.out.print(prefix);
672                 System.out.println(array[i]);
673             }
674         }
675         else {
676             System.out.println(" none.");
677         }
678     } // print(String,String,Object[])
679

680 } // class Constants
681
Popular Tags