The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。
See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
Processing Limit Definitions
The following list describes the JAXP XML Processing Limits supported in the JDK. These limits can be specified through the factory APIs, system properties, and the jaxp.properties file.
entityExpansionLimit
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit |
Definition |
Limit the number of entity expansions. |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
64000 |
System property |
jdk.xml.entityExpansionLimit |
Since |
7u45, 8 |
elementAttributeLimit
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/elementAttributeLimit |
Definition |
Limit the number of attributes an element can have. |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
10000 |
System property |
jdk.xml.elementAttributeLimit |
Since |
7u45, 8 |
maxOccurLimit
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/maxOccurLimit |
Definition |
Limit the number of content model nodes that may be created when building a grammar for a W3C XML Schema that contains maxOccurs attributes with values other than "unbounded". |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
5000 |
System property |
jdk.xml.maxOccurLimit |
Since |
7u45, 8 |
totalEntitySizeLimit
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/totalEntitySizeLimit |
Definition |
Limit the total size of all entities that include general and parameter entities. The size is calculated as an aggregation of all entities. |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
5x10^7 |
System property |
jdk.xml.totalEntitySizeLimit |
Since |
7u45, 8 |
maxGeneralEntitySizeLimit
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/maxGeneralEntitySizeLimit |
Definition |
Limit the maximum size of any general entities. |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
0 |
System property |
jdk.xml.maxGeneralEntitySizeLimit |
Since |
7u45, 8 |
maxParameterEntitySizeLimit
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/maxParameterEntitySizeLimit |
Definition |
Limit the maximum size of any parameter entities, including the result of nesting multiple parameter entities. |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
1000000 |
System property |
jdk.xml.maxParameterEntitySizeLimit |
Since |
7u45, 8 |
entityReplacementLimit
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/entityReplacementLimit |
Definition |
Limit the total number of nodes in all entity references. |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
3000000 |
System property |
jdk.xml.entityReplacementLimit |
Since |
7u111, 8u101 |
maxElementDepth
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/maxElementDepth |
Definition |
Limit the maximum element depth. |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
0 |
System property |
jdk.xml.maxElementDepth |
Since |
7u65, 8u11 |
maxXMLNameLimit
Attribute |
Description |
Name |
http://www.oracle.com/xml/jaxp/properties/maxXMLNameLimit |
Definition |
Limit the maximum size of XML names, including element name, attribute name and namespace prefix and URI. |
Value |
A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown. |
Default value |
1000 |
System property |
jdk.xml.maxXMLNameLimit |
Since |
7u91, 8u65 |
Legacy System Properties
These properties, which were introduced since JDK 5.0 and 6, continue to be supported for backward compatibility.
System Property |
Since |
New System Property |
entityExpansionLimit |
1.5 |
jdk.xml.entityExpansionLimit |
elementAttributeLimit |
1.5 |
jdk.xml.elementAttributeLimit |
maxOccurLimit |
1.6 |
jdk.xml.maxOccur |
{java.home}/lib/jaxp.properties
The system properties can be specified in the jaxp.properties file to define the behavior for all invocations of the JDK or JRE. The format is system-property-name=value. For example:
jdk.xml.maxGeneralEntitySizeLimit=1024