📄 constants.java
字号:
public static final String SYMBOL_TABLE_PROPERTY = "internal/symbol-table"; /** Error reporter property ("internal/error-reporter"). */ public static final String ERROR_REPORTER_PROPERTY = "internal/error-reporter"; /** Error handler property ("internal/error-handler"). */ public static final String ERROR_HANDLER_PROPERTY = "internal/error-handler"; /** XInclude handler property ("internal/xinclude-handler"). */ public static final String XINCLUDE_HANDLER_PROPERTY = "internal/xinclude-handler"; /** XPointer handler property ("internal/xpointer-handler"). */ public static final String XPOINTER_HANDLER_PROPERTY = "internal/xpointer-handler"; /** Entity manager property ("internal/entity-manager"). */ public static final String ENTITY_MANAGER_PROPERTY = "internal/entity-manager"; /** Input buffer size property ("input-buffer-size"). */ public static final String BUFFER_SIZE_PROPERTY = "input-buffer-size"; /** Security manager property ("security-manager"). */ public static final String SECURITY_MANAGER_PROPERTY = "security-manager"; /** property identifier: security manager. */ protected static final String SECURITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; public static final String ENTITY_RESOLVER_PROPERTY = "internal/entity-resolver"; /** Grammar pool property ("internal/grammar-pool"). */ public static final String XMLGRAMMAR_POOL_PROPERTY = "internal/grammar-pool"; /** Datatype validator factory ("internal/datatype-validator-factory"). */ public static final String DATATYPE_VALIDATOR_FACTORY_PROPERTY = "internal/datatype-validator-factory"; /** Document scanner property ("internal/document-scanner"). */ public static final String DOCUMENT_SCANNER_PROPERTY = "internal/document-scanner"; /** DTD scanner property ("internal/dtd-scanner"). */ public static final String DTD_SCANNER_PROPERTY = "internal/dtd-scanner"; /** DTD processor property ("internal/dtd-processor"). */ public static final String DTD_PROCESSOR_PROPERTY = "internal/dtd-processor"; /** Validator property ("internal/validator"). */ public static final String VALIDATOR_PROPERTY = "internal/validator"; /** Validator property ("internal/validator/dtd"). */ public static final String DTD_VALIDATOR_PROPERTY = "internal/validator/dtd"; /** Validator property ("internal/validator/schema"). */ public static final String SCHEMA_VALIDATOR_PROPERTY = "internal/validator/schema"; /** No namespace schema location property ("schema/external-schemaLocation"). */ public static final String SCHEMA_LOCATION = "schema/external-schemaLocation"; /** Schema location property ("schema/external-noNamespaceSchemaLocation"). */ public static final String SCHEMA_NONS_LOCATION = "schema/external-noNamespaceSchemaLocation"; /** Namespace binder property ("internal/namespace-binder"). */ public static final String NAMESPACE_BINDER_PROPERTY = "internal/namespace-binder"; /** Namespace context property ("internal/namespace-context"). */ public static final String NAMESPACE_CONTEXT_PROPERTY = "internal/namespace-context"; /** Validation manager property ("internal/validation-manager"). */ public static final String VALIDATION_MANAGER_PROPERTY = "internal/validation-manager"; /** XPointer Schema property ("xpointer-schema"). */ public static final String XPOINTER_SCHEMA_PROPERTY = "xpointer-schema"; // general constants /** Element PSVI is stored in augmentations using string "ELEMENT_PSVI" */ public final static String ELEMENT_PSVI = "ELEMENT_PSVI"; /* Attribute PSVI is stored in augmentations using string "ATTRIBUTE_PSVI" */ public final static String ATTRIBUTE_PSVI = "ATTRIBUTE_PSVI"; /** * Boolean indicating whether an attribute is declared in the DTD is stored * in augmentations using the string "ATTRIBUTE_DECLARED". The absence of this * augmentation indicates that the attribute was not declared in the DTD. */ public final static String ATTRIBUTE_DECLARED = "ATTRIBUTE_DECLARED"; public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit"; public final static String MAX_OCCUR_LIMIT = "maxOccurLimit"; /** * {@link org.w3c.dom.TypeInfo} associated with current element/attribute * is stored in augmentations using this string as the key. * * This will ultimately controls {@link com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser} * regarding what object the DOM will return from * {@link org.w3c.dom.Attr#getSchemaTypeInfo()} and * {@link org.w3c.dom.Element#getSchemaTypeInfo()} and */ public final static String TYPEINFO = "org.w3c.dom.TypeInfo"; /** * Whether an attribute is an id or not is stored in augmentations * using this string as the key. The value is {@link Boolean#TRUE} * or {@link Boolean#FALSE}. * * This will ultimately controls {@link com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser} * about whether it will mark an attribute as ID or not. */ public final static String ID_ATTRIBUTE = "ID_ATTRIBUTE"; // XML version constants /** * Boolean indicating whether an entity referenced in the document has * not been read is stored in augmentations using the string "ENTITY_SKIPPED". * The absence of this augmentation indicates that the entity had a * declaration and was expanded. */ public final static String ENTITY_SKIPPED = "ENTITY_SKIPPED"; /** * Boolean indicating whether a character is a probable white space * character (ch <= 0x20) that was the replacement text of a character * reference is stored in augmentations using the string "CHAR_REF_PROBABLE_WS". * The absence of this augmentation indicates that the character is not * probable white space and/or was not included from a character reference. */ public final static String CHAR_REF_PROBABLE_WS = "CHAR_REF_PROBABLE_WS"; /** Boolean indicating if this entity is the last opened entity. * *@see com.sun.org.apache.xerces.internal.impl.XMLEntityManager#endEntity() *@see com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl#endEntity() *@see com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl#endEntity() */ public final static String LAST_ENTITY = "LAST_ENTITY"; // XML version constants public final static short XML_VERSION_1_0 = 1; public final static short XML_VERSION_1_1 = 2; // DOM related constants public final static String ANONYMOUS_TYPE_NAMESPACE = "http://apache.org/xml/xmlschema/1.0/anonymousTypes"; // Constant to enable Schema 1.1 support public final static boolean SCHEMA_1_1_SUPPORT = false; // private /** SAX features. */ private static final String[] fgSAXFeatures = { NAMESPACES_FEATURE, NAMESPACE_PREFIXES_FEATURE, STRING_INTERNING_FEATURE, VALIDATION_FEATURE, EXTERNAL_GENERAL_ENTITIES_FEATURE, EXTERNAL_PARAMETER_ENTITIES_FEATURE, }; /** SAX properties. */ private static final String[] fgSAXProperties = { DECLARATION_HANDLER_PROPERTY, LEXICAL_HANDLER_PROPERTY, DOM_NODE_PROPERTY, XML_STRING_PROPERTY, }; /** Xerces features. */ private static final String[] fgXercesFeatures = { SCHEMA_VALIDATION_FEATURE, SCHEMA_FULL_CHECKING, DYNAMIC_VALIDATION_FEATURE, WARN_ON_DUPLICATE_ATTDEF_FEATURE, WARN_ON_UNDECLARED_ELEMDEF_FEATURE, ALLOW_JAVA_ENCODINGS_FEATURE, CONTINUE_AFTER_FATAL_ERROR_FEATURE, LOAD_DTD_GRAMMAR_FEATURE, LOAD_EXTERNAL_DTD_FEATURE, //DEFER_NODE_EXPANSION_FEATURE, CREATE_ENTITY_REF_NODES_FEATURE, XINCLUDE_AWARE, INCLUDE_IGNORABLE_WHITESPACE, //GRAMMAR_ACCESS_FEATURE, DEFAULT_ATTRIBUTE_VALUES_FEATURE, VALIDATE_CONTENT_MODELS_FEATURE, VALIDATE_DATATYPES_FEATURE, NOTIFY_CHAR_REFS_FEATURE, NOTIFY_BUILTIN_REFS_FEATURE, DISALLOW_DOCTYPE_DECL_FEATURE, STANDARD_URI_CONFORMANT_FEATURE, GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE, VALIDATE_ANNOTATIONS_FEATURE, HONOUR_ALL_SCHEMALOCATIONS_FEATURE, XINCLUDE_FEATURE, XINCLUDE_FIXUP_BASE_URIS_FEATURE, XINCLUDE_FIXUP_LANGUAGE_FEATURE }; /** Xerces properties. */ private static final String[] fgXercesProperties = { CURRENT_ELEMENT_NODE_PROPERTY, DOCUMENT_CLASS_NAME_PROPERTY, SYMBOL_TABLE_PROPERTY, ERROR_HANDLER_PROPERTY, ERROR_REPORTER_PROPERTY, ENTITY_MANAGER_PROPERTY, ENTITY_RESOLVER_PROPERTY, XMLGRAMMAR_POOL_PROPERTY, DATATYPE_VALIDATOR_FACTORY_PROPERTY, DOCUMENT_SCANNER_PROPERTY, DTD_SCANNER_PROPERTY, VALIDATOR_PROPERTY, SCHEMA_LOCATION, SCHEMA_NONS_LOCATION, VALIDATION_MANAGER_PROPERTY, BUFFER_SIZE_PROPERTY, SECURITY_MANAGER_PROPERTY }; /** Empty enumeration. */ private static final Enumeration fgEmptyEnumeration = new ArrayEnumeration(new Object[] {}); // // Constructors // /** This class cannot be instantiated. */ private Constants() {} // // Public methods // // sax /** Returns an enumeration of the SAX features. */ public static Enumeration getSAXFeatures() { return fgSAXFeatures.length > 0 ? new ArrayEnumeration(fgSAXFeatures) : fgEmptyEnumeration; } // getSAXFeatures():Enumeration /** Returns an enumeration of the SAX properties. */ public static Enumeration getSAXProperties() { return fgSAXProperties.length > 0 ? new ArrayEnumeration(fgSAXProperties) : fgEmptyEnumeration; } // getSAXProperties():Enumeration // xerces /** Returns an enumeration of the Xerces features. */ public static Enumeration getXercesFeatures() { return fgXercesFeatures.length > 0 ? new ArrayEnumeration(fgXercesFeatures) : fgEmptyEnumeration; } // getXercesFeatures():Enumeration /** Returns an enumeration of the Xerces properties. */ public static Enumeration getXercesProperties() { return fgXercesProperties.length > 0 ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration; } // getXercesProperties():Enumeration // // Classes // /** * An array enumeration. * * @author Andy Clark, IBM */ static class ArrayEnumeration implements Enumeration { // // Data // /** Array. */ private Object[] array; /** Index. */ private int index; // // Constructors // /** Constructs an array enumeration. */ public ArrayEnumeration(Object[] array) { this.array = array; } // <init>(Object[]) // // Enumeration methods // /** * Tests if this enumeration contains more elements. * * @return <code>true</code> if this enumeration contains more elements; * <code>false</code> otherwise. * @since JDK1.0 */ public boolean hasMoreElements() { return index < array.length; } // hasMoreElement():boolean /** * Returns the next element of this enumeration. * * @return the next element of this enumeration. * @exception NoSuchElementException if no more elements exist. * @since JDK1.0 */ public Object nextElement() { if (index < array.length) { return array[index++]; } throw new NoSuchElementException(); } // nextElement():Object } // class ArrayEnumeration // // MAIN // /** Prints all of the constants to standard output. */ public static void main(String[] argv) { print("SAX features:", SAX_FEATURE_PREFIX, fgSAXFeatures); print("SAX properties:", SAX_PROPERTY_PREFIX, fgSAXProperties); print("Xerces features:", XERCES_FEATURE_PREFIX, fgXercesFeatures); print("Xerces properties:", XERCES_PROPERTY_PREFIX, fgXercesProperties); } // main(String[]) /** Prints a list of features/properties. */ private static void print(String header, String prefix, Object[] array) { System.out.print(header); if (array.length > 0) { System.out.println(); for (int i = 0; i < array.length; i++) { System.out.print(" "); System.out.print(prefix); System.out.println(array[i]); } } else { System.out.println(" none."); } } // print(String,String,Object[]) } // class Constants
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -