/*
*/
/*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Commonly used constants.
*
* @xerces.internal
*
* @author Andy Clark, IBM
*
* @version $Id: Constants.java,v 1.14 2010-11-01 04:39:40 joehw Exp $
*/
public final class Constants {
//
// Constants
//
// Schema Types:
// Schema features
public static final String SUN_REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE = "report-ignored-element-content-whitespace";
//stax properties
public static final String READER_IN_DEFINED_STATE = ZEPHYR_PROPERTY_PREFIX + "reader-in-defined-state" ;
//DOM properties
/**
* If true, ignore DOCTYPE declaration as if it wasn't present at all.
* Note that this is a violation of the XML recommendation.
* The full property name is prefixed by {@link #ZEPHYR_PROPERTY_PREFIX}.
*/
// sax features
/** SAX feature prefix ("http://xml.org/sax/features/"). */
/** Namespace prefixes feature ("namespace-prefixes"). */
/** String interning feature ("string-interning"). */
/** Validation feature ("validation"). */
/** External general entities feature ("external-general-entities "). */
/** External parameter entities feature ("external-parameter-entities "). */
/** Lexical handler parameter entities feature ("lexical-handler/parameter-entities"). */
public static final String LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE = "lexical-handler/parameter-entities";
/** Is standalone feature ("is-standalone"). */
/** Resolve DTD URIs feature ("resolve-dtd-uris"). */
/** Use Attributes2 feature ("use-attributes2"). */
/** Use Locator2 feature ("use-locator2"). */
/** Use EntityResolver2 feature ("use-entity-resolver2"). */
/** Unicode normalization checking feature ("unicode-normalization-checking"). */
public static final String UNICODE_NORMALIZATION_CHECKING_FEATURE = "unicode-normalization-checking";
/** xmlns URIs feature ("xmlns-uris"). */
/** XML 1.1 feature ("xml-1.1"). */
/** Allow unparsed entity and notation declaration events to be sent after the end DTD event ("allow-dtd-events-after-endDTD") */
// sax properties
/** SAX property prefix ("http://xml.org/sax/properties/"). */
/** Declaration handler property ("declaration-handler"). */
/** Lexical handler property ("lexical-handler"). */
/** DOM node property ("dom-node"). */
/** XML string property ("xml-string"). */
public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
// Oracle Feature:
/**
* <p>Use Service Mechanism</p>
*
* <ul>
* <li>
* {@code true} instruct an object to use service mechanism to
* find a service implementation. This is the default behavior.
* </li>
* <li>
* {@code false} instruct an object to skip service mechanism and
* use the default implementation for that service.
* </li>
* </ul>
*/
public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism";
/** Document XML version property ("document-xml-version"). */
//
// JAXP properties
//
/** JAXP property prefix ("http://java.sun.com/xml/jaxp/properties/"). */
/** JAXP schemaSource property: when used internally may include DTD sources (DOM) */
/** JAXP schemaSource language: when used internally may include DTD namespace (DOM) */
/** JAXP Standard property prefix ("http://javax.xml.XMLConstants/property/"). */
/** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */
//System Properties corresponding to ACCESS_EXTERNAL_* properties
//all access keyword
/**
* Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true
*/
/**
* JDK version by which the default is to restrict external connection
*/
/**
* FEATURE_SECURE_PROCESSING (FSP) is true by default
*/
//
// DOM features
//
/** Comments feature ("include-comments"). */
/** Create cdata nodes feature ("create-cdata-nodes"). */
/** Feature id: load as infoset. */
//
// Constants: DOM Level 3 feature ids
//
// REVISIT: this feature seems to have no effect for Xerces
"charset-overrides-xml-encoding";
"supported-media-types-only";
"element-content-whitespace";
// DOM Level 3 features defined in Core:
// Load and Save
public static final String DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS = "ignore-unknown-character-denormalizations";
// DOM Properties
// XSModel
// xerces features
/** Xerces features prefix ("http://apache.org/xml/features/"). */
/** Schema validation feature ("validation/schema"). */
/** Expose schema normalized values */
/** Send schema default value via characters() */
/** Schema full constraint checking ("validation/schema-full-checking"). */
/** Augment Post-Schema-Validation-Infoset */
/** Dynamic validation feature ("validation/dynamic"). */
/** Warn on duplicate attribute declaration feature ("validation/warn-on-duplicate-attdef"). */
public static final String WARN_ON_DUPLICATE_ATTDEF_FEATURE = "validation/warn-on-duplicate-attdef";
/** Warn on undeclared element feature ("validation/warn-on-undeclared-elemdef"). */
public static final String WARN_ON_UNDECLARED_ELEMDEF_FEATURE = "validation/warn-on-undeclared-elemdef";
/** Warn on duplicate entity declaration feature ("warn-on-duplicate-entitydef"). */
/** Allow Java encoding names feature ("allow-java-encodings"). */
/** Disallow DOCTYPE declaration feature ("disallow-doctype-decl"). */
/** Continue after fatal error feature ("continue-after-fatal-error"). */
/** Load dtd grammar when nonvalidating feature ("nonvalidating/load-dtd-grammar"). */
/** Load external dtd when nonvalidating feature ("nonvalidating/load-external-dtd"). */
/** Defer node expansion feature ("dom/defer-node-expansion"). */
/** Create entity reference nodes feature ("dom/create-entity-ref-nodes"). */
/** Include ignorable whitespace feature ("dom/include-ignorable-whitespace"). */
/** Default attribute values feature ("validation/default-attribute-values"). */
public static final String DEFAULT_ATTRIBUTE_VALUES_FEATURE = "validation/default-attribute-values";
/** Validate content models feature ("validation/validate-content-models"). */
/** Validate datatypes feature ("validation/validate-datatypes"). */
/** Balance syntax trees feature ("validation/balance-syntax-trees"). */
/** Notify character references feature (scanner/notify-char-refs"). */
/** Notify built-in (&amp;, etc.) references feature (scanner/notify-builtin-refs"). */
/** Standard URI conformant feature ("standard-uri-conformant"). */
/** Generate synthetic annotations feature ("generate-synthetic-annotations"). */
public static final String GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE = "generate-synthetic-annotations";
/** Validate annotations feature ("validate-annotations"). */
/** Honour all schemaLocations feature ("honour-all-schemaLocations"). */
/** Namespace growth feature ("namespace-growth"). */
/** Tolerate duplicates feature ("internal/tolerate-duplicates"). */
/** XInclude processing feature ("xinclude"). */
/** XInclude fixup base URIs feature ("xinclude/fixup-base-uris"). */
/** XInclude fixup language feature ("xinclude/fixup-language"). */
/**
* Internal feature. When set to true the schema validator will only use
* schema components from the grammar pool provided.
*/
public static final String USE_GRAMMAR_POOL_ONLY_FEATURE = "internal/validation/schema/use-grammar-pool-only";
/** Internal performance related feature:
* false - the parser settings (features/properties) have not changed between 2 parses
* true - the parser settings have changed between 2 parses
* NOTE: this feature should only be set by the parser configuration.
*/
/** Feature to make XML Processor XInclude Aware */
/** Ignore xsi:schemaLocation and xsi:noNamespaceSchemaLocation. */
public static final String IGNORE_SCHEMA_LOCATION_HINTS = "validation/schema/ignore-schema-location-hints";
/**
* When true, the schema processor will change characters events
* to ignorableWhitespaces events, when characters are expected to
* only contain ignorable whitespaces.
*/
// xerces properties
/** Xerces properties prefix ("http://apache.org/xml/properties/"). */
/** Current element node property ("dom/current-element-node"). */
/** Document class name property ("dom/document-class-name"). */
/** Symbol table property ("internal/symbol-table"). */
/** Error reporter property ("internal/error-reporter"). */
/** Error handler property ("internal/error-handler"). */
/** XInclude handler property ("internal/xinclude-handler"). */
/** XPointer handler property ("internal/xpointer-handler"). */
/** Entity manager property ("internal/entity-manager"). */
/** Input buffer size property ("input-buffer-size"). */
/** Security manager property ("security-manager"). */
/** Locale property ("locale"). */
/** property identifier: security manager. */
/** Grammar 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"). */
/** DTD scanner property ("internal/dtd-scanner"). */
/** DTD processor property ("internal/dtd-processor"). */
/** No namespace schema location property ("schema/external-schemaLocation"). */
/** Schema location property ("schema/external-noNamespaceSchemaLocation"). */
/** Namespace binder property ("internal/namespace-binder"). */
/** Namespace context property ("internal/namespace-context"). */
/** Validation manager property ("internal/validation-manager"). */
/** XPointer Schema property ("xpointer-schema"). */
/** Schema element declaration for the root element in a document ("internal/validation/schema/dv-factory"). */
// general constants
/** Element PSVI is stored in augmentations using string "ELEMENT_PSVI" */
/** Attribute PSVI is stored in augmentations using string "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.
*/
/**
* 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
*/
/**
* 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.
*/
// 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.
*/
/**
* 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
*/
/** 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()
*/
// XML version constants
// DOM related constants
// Constant to enable Schema 1.1 support
public final static boolean SCHEMA_1_1_SUPPORT = false;
// private
/** SAX features. */
};
/** SAX properties. */
};
/** Xerces features. */
//DEFER_NODE_EXPANSION_FEATURE,
//GRAMMAR_ACCESS_FEATURE,
};
/** Xerces properties. */
};
/** Empty enumeration. */
//
// Constructors
//
/** This class cannot be instantiated. */
private Constants() {}
//
// Public methods
//
// sax
/** Returns an enumeration of the SAX features. */
} // getSAXFeatures():Enumeration
/** Returns an enumeration of the SAX properties. */
} // getSAXProperties():Enumeration
// xerces
/** Returns an enumeration of the Xerces features. */
} // getXercesFeatures():Enumeration
/** Returns an enumeration of the Xerces properties. */
} // getXercesProperties():Enumeration
/**
* Determine the default value of the external access properties
*
* jaxp 1.5 does not require implementations to restrict by default
*
* For JDK8:
* The default value is 'file' (including jar:file); The keyword "all" grants permission
* to all protocols. When {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} is on,
* the default value is an empty string indicating no access is allowed.
*
* For JDK7:
* The default value is 'all' granting permission to all protocols. If by default,
* {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} is true, it should
* not change the default value. However, if {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING}
* is set explicitly, the values of the properties shall be set to an empty string
* indicating no access is allowed.
*
* @param isSecureProcessing indicating if Secure Processing is set
* @return default value
*/
defaultValue = "file";
if (isSecureProcessing) {
}
}
return defaultValue;
}
/*
* Check the version of the current JDK against that specified in the
* parameter
*
* There is a proposal to change the java version string to:
* MAJOR.MINOR.FU.CPU.PSU-BUILDNUMBER_BUGIDNUMBER_OPTIONAL
* This method would work with both the current format and that proposed
*
* @param compareTo a JDK version to be compared to
* @return true if the current version is the same or above that represented
* by the parameter
*/
return true;
}
return false;
}
//
// Classes
//
/**
* An array enumeration.
*
* @author Andy Clark, IBM
*/
static class ArrayEnumeration
implements Enumeration {
//
// Data
//
/** Array. */
/** Index. */
private int index;
//
// Constructors
//
/** Constructs an array enumeration. */
} // <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() {
} // 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
*/
}
throw new NoSuchElementException();
} // nextElement():Object
} // class ArrayEnumeration
//
// MAIN
//
/** Prints all of the constants to standard output. */
} // main(String[])
/** Prints a list of features/properties. */
}
}
else {
}
} // print(String,String,Object[])
} // class Constants