Package com.helger.xml
Class XMLSystemProperties
java.lang.Object
com.helger.xml.XMLSystemProperties
This class wraps all the special Java XML system properties.
- Author:
- Philip Helger
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic intstatic intstatic intstatic intstatic intstatic voidsetXMLElementAttributeLimit(int nElementAttributeLimit) Limit the number of attributes an element can have.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used.static voidsetXMLElementAttributeLimit(String sElementAttributeLimit) Limit the number of attributes an element can have.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used.static voidsetXMLElementAttributeLimitIfLarger(int nElementAttributeLimit) The same assetXMLElementAttributeLimit(int)but just that the value is only set, if the limit is increased!static voidsetXMLEntityExpansionLimit(int nEntityExpansionLimit) Limit the number of entity expansions.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used.static voidsetXMLEntityExpansionLimit(String sEntityExpansionLimit) Limit the number of entity expansions.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used.static voidsetXMLEntityExpansionLimitIfLarger(int nMaxOccur) The same assetXMLEntityExpansionLimit(int)but just that the value is only set, if the limit is increased!static voidsetXMLMaxGeneralEntitySizeLimit(int nMaxGeneralEntitySizeLimit) Limit the maximum size of any general entities.static voidsetXMLMaxGeneralEntitySizeLimit(String sMaxGeneralEntitySizeLimit) Limit the maximum size of any general entities.static voidsetXMLMaxGeneralEntitySizeLimitIfLarger(int nMaxGeneralEntitySizeLimit) The same assetXMLMaxGeneralEntitySizeLimit(int)but just that the value is only set, if the limit is increased!static voidsetXMLMaxOccur(int nMaxOccur) 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".
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used.static voidsetXMLMaxOccur(String sMaxOccur) 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".
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used.static voidsetXMLMaxOccurIfLarger(int nMaxOccur) The same assetXMLMaxOccur(int)but just that the value is only set, if the limit is increased!static voidsetXMLMaxParameterEntitySizeLimit(int nMaxParameterEntitySizeLimit) Limit the maximum size of any parameter entities, including the result of nesting multiple parameter entities.static voidsetXMLMaxParameterEntitySizeLimit(String sMaxParameterEntitySizeLimit) Limit the maximum size of any parameter entities, including the result of nesting multiple parameter entities.static voidsetXMLMaxParameterEntitySizeLimitIfLarger(int nMaxParameterEntitySizeLimit) The same assetXMLMaxParameterEntitySizeLimit(int)but just that the value is only set, if the limit is increased!static voidsetXMLTotalEntitySizeLimit(int nTotalEntitySizeLimit) Limit the total size of all entities that include general and parameter entities.static voidsetXMLTotalEntitySizeLimit(String sTotalEntitySizeLimit) Limit the total size of all entities that include general and parameter entities.static voidsetXMLTotalEntitySizeLimitIfLarger(int nTotalEntitySizeLimit) The same assetXMLTotalEntitySizeLimit(int)but just that the value is only set, if the limit is increased!
-
Field Details
-
SYSTEM_PROPERTY_JDX_XML_ENTITY_EXPANSION_LIMIT
- See Also:
-
SYSTEM_PROPERTY_ENTITY_EXPANSION_LIMIT
- See Also:
-
SYSTEM_PROPERTY_JDX_XML_ELEMENT_ATTRIBUTE_LIMIT
- See Also:
-
SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT
- See Also:
-
SYSTEM_PROPERTY_JDX_XML_MAX_OCCUR
- See Also:
-
SYSTEM_PROPERTY_MAX_OCCUR
- See Also:
-
SYSTEM_PROPERTY_JDX_XML_TOTAL_ENTITY_SIZE_LIMIT
- See Also:
-
SYSTEM_PROPERTY_JDX_XML_MAX_GENERAL_ENTITY_SIZE_LIMIT
- See Also:
-
SYSTEM_PROPERTY_JDX_XML_MAX_PARAMETER_ENTITY_SIZE_LIMIT
- See Also:
-
-
Method Details
-
setXMLEntityExpansionLimit
public static void setXMLEntityExpansionLimit(int nEntityExpansionLimit) Limit the number of entity expansions.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
nEntityExpansionLimit- A positive integer. Values ≤ 0 are treated as no limit.
-
setXMLEntityExpansionLimit
Limit the number of entity expansions.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
sEntityExpansionLimit- A positive integer as a String. Values ≤ 0 are treated as no limit.nullmeans the property is deleted
-
setXMLEntityExpansionLimitIfLarger
public static void setXMLEntityExpansionLimitIfLarger(int nMaxOccur) The same assetXMLEntityExpansionLimit(int)but just that the value is only set, if the limit is increased!- Parameters:
nMaxOccur- A positive integer. Values ≤ 0 are treated as no limit.- Since:
- 8.6.2
- See Also:
-
getXMLEntityExpansionLimit
public static int getXMLEntityExpansionLimit() -
setXMLElementAttributeLimit
public static void setXMLElementAttributeLimit(int nElementAttributeLimit) Limit the number of attributes an element can have.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
nElementAttributeLimit- A positive integer. Values ≤ 0 are treated as no limit.
-
setXMLElementAttributeLimit
Limit the number of attributes an element can have.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
sElementAttributeLimit- A positive integer. Values ≤ 0 are treated as no limit.nullmeans the property is deleted- Since:
- 8.6.2
-
setXMLElementAttributeLimitIfLarger
public static void setXMLElementAttributeLimitIfLarger(int nElementAttributeLimit) The same assetXMLElementAttributeLimit(int)but just that the value is only set, if the limit is increased!- Parameters:
nElementAttributeLimit- A positive integer. Values ≤ 0 are treated as no limit.- Since:
- 8.6.2
- See Also:
-
getXMLElementAttributeLimit
public static int getXMLElementAttributeLimit() -
setXMLMaxOccur
public static void setXMLMaxOccur(int nMaxOccur) 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".
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
nMaxOccur- A positive integer. Values ≤ 0 are treated as no limit.
-
setXMLMaxOccur
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".
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
sMaxOccur- A positive integer. Values ≤ 0 are treated as no limit.nullmeans the property is deleted.- Since:
- 8.6.2
-
setXMLMaxOccurIfLarger
public static void setXMLMaxOccurIfLarger(int nMaxOccur) The same assetXMLMaxOccur(int)but just that the value is only set, if the limit is increased!- Parameters:
nMaxOccur- A positive integer. Values ≤ 0 are treated as no limit.- Since:
- 8.6.2
- See Also:
-
getXMLMaxOccur
public static int getXMLMaxOccur() -
setXMLTotalEntitySizeLimit
public static void setXMLTotalEntitySizeLimit(int nTotalEntitySizeLimit) Limit the total size of all entities that include general and parameter entities. The size is calculated as an aggregation of all entities.
This is available since JDK 1.7.0_45/1.8.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
nTotalEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.
-
setXMLTotalEntitySizeLimit
Limit the total size of all entities that include general and parameter entities. The size is calculated as an aggregation of all entities.
This is available since JDK 1.7.0_45/1.8.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
sTotalEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.nullmeans the property is deleted.- Since:
- 8.6.2
-
setXMLTotalEntitySizeLimitIfLarger
public static void setXMLTotalEntitySizeLimitIfLarger(int nTotalEntitySizeLimit) The same assetXMLTotalEntitySizeLimit(int)but just that the value is only set, if the limit is increased!- Parameters:
nTotalEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.- Since:
- 8.6.2
- See Also:
-
getXMLTotalEntitySizeLimit
public static int getXMLTotalEntitySizeLimit() -
setXMLMaxGeneralEntitySizeLimit
public static void setXMLMaxGeneralEntitySizeLimit(int nMaxGeneralEntitySizeLimit) Limit the maximum size of any general entities. It is recommended that users set the limit to the smallest possible number so that malformed xml files can be caught quickly.
This is available since JDK 1.7.0_45/1.8.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
nMaxGeneralEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.
-
setXMLMaxGeneralEntitySizeLimit
Limit the maximum size of any general entities. It is recommended that users set the limit to the smallest possible number so that malformed xml files can be caught quickly.
This is available since JDK 1.7.0_45/1.8.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
sMaxGeneralEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.nullmeans the property is deleted.- Since:
- 8.6.2
-
setXMLMaxGeneralEntitySizeLimitIfLarger
public static void setXMLMaxGeneralEntitySizeLimitIfLarger(int nMaxGeneralEntitySizeLimit) The same assetXMLMaxGeneralEntitySizeLimit(int)but just that the value is only set, if the limit is increased!- Parameters:
nMaxGeneralEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.- Since:
- 8.6.2
- See Also:
-
getXMLMaxGeneralEntitySizeLimit
public static int getXMLMaxGeneralEntitySizeLimit() -
setXMLMaxParameterEntitySizeLimit
public static void setXMLMaxParameterEntitySizeLimit(int nMaxParameterEntitySizeLimit) Limit the maximum size of any parameter entities, including the result of nesting multiple parameter entities. It is recommended that users set the limit to the smallest possible number so that malformed xml files can be caught quickly.
This is available since JDK 1.7.0_45/1.8.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
nMaxParameterEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.
-
setXMLMaxParameterEntitySizeLimit
Limit the maximum size of any parameter entities, including the result of nesting multiple parameter entities. It is recommended that users set the limit to the smallest possible number so that malformed xml files can be caught quickly.
This is available since JDK 1.7.0_45/1.8.
This setting only takes effect if a parser with explicitly disabled "Secure processing" feature is used. Otherwise this setting has no effect!- Parameters:
sMaxParameterEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.nullmeans the property is deleted.- Since:
- 8.6.2
-
setXMLMaxParameterEntitySizeLimitIfLarger
public static void setXMLMaxParameterEntitySizeLimitIfLarger(int nMaxParameterEntitySizeLimit) The same assetXMLMaxParameterEntitySizeLimit(int)but just that the value is only set, if the limit is increased!- Parameters:
nMaxParameterEntitySizeLimit- A positive integer. Values ≤ 0 are treated as no limit.- Since:
- 8.6.2
- See Also:
-
getXMLMaxParameterEntitySizeLimit
public static int getXMLMaxParameterEntitySizeLimit()
-