Package com.helger.xml
Class XMLSystemProperties
- java.lang.Object
-
- com.helger.xml.XMLSystemProperties
-
@ThreadSafe public final class XMLSystemProperties extends Object
This class wraps all the special Java XML system properties.- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static StringSYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMITstatic StringSYSTEM_PROPERTY_ENTITY_EXPANSION_LIMITstatic StringSYSTEM_PROPERTY_JDX_XML_ELEMENT_ATTRIBUTE_LIMITstatic StringSYSTEM_PROPERTY_JDX_XML_ENTITY_EXPANSION_LIMITstatic StringSYSTEM_PROPERTY_JDX_XML_MAX_GENERAL_ENTITY_SIZE_LIMITstatic StringSYSTEM_PROPERTY_JDX_XML_MAX_OCCURstatic StringSYSTEM_PROPERTY_JDX_XML_MAX_PARAMETER_ENTITY_SIZE_LIMITstatic StringSYSTEM_PROPERTY_JDX_XML_TOTAL_ENTITY_SIZE_LIMITstatic StringSYSTEM_PROPERTY_MAX_OCCUR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetXMLElementAttributeLimit()static intgetXMLEntityExpansionLimit()static intgetXMLMaxGeneralEntitySizeLimit()static intgetXMLMaxOccur()static intgetXMLMaxParameterEntitySizeLimit()static intgetXMLTotalEntitySizeLimit()static 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 Detail
-
SYSTEM_PROPERTY_JDX_XML_ENTITY_EXPANSION_LIMIT
public static final String SYSTEM_PROPERTY_JDX_XML_ENTITY_EXPANSION_LIMIT
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_ENTITY_EXPANSION_LIMIT
public static final String SYSTEM_PROPERTY_ENTITY_EXPANSION_LIMIT
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JDX_XML_ELEMENT_ATTRIBUTE_LIMIT
public static final String SYSTEM_PROPERTY_JDX_XML_ELEMENT_ATTRIBUTE_LIMIT
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT
public static final String SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JDX_XML_MAX_OCCUR
public static final String SYSTEM_PROPERTY_JDX_XML_MAX_OCCUR
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_MAX_OCCUR
public static final String SYSTEM_PROPERTY_MAX_OCCUR
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JDX_XML_TOTAL_ENTITY_SIZE_LIMIT
public static final String SYSTEM_PROPERTY_JDX_XML_TOTAL_ENTITY_SIZE_LIMIT
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JDX_XML_MAX_GENERAL_ENTITY_SIZE_LIMIT
public static final String SYSTEM_PROPERTY_JDX_XML_MAX_GENERAL_ENTITY_SIZE_LIMIT
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JDX_XML_MAX_PARAMETER_ENTITY_SIZE_LIMIT
public static final String SYSTEM_PROPERTY_JDX_XML_MAX_PARAMETER_ENTITY_SIZE_LIMIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public static void setXMLEntityExpansionLimit(@Nullable String sEntityExpansionLimit)
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:
setXMLEntityExpansionLimit(int)
-
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
public static void setXMLElementAttributeLimit(@Nullable 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. 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:
setXMLElementAttributeLimit(int)
-
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
public static void setXMLMaxOccur(@Nullable 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. 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:
setXMLMaxOccur(int)
-
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
public static void setXMLTotalEntitySizeLimit(@Nullable String sTotalEntitySizeLimit)
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:
setXMLTotalEntitySizeLimit(int)
-
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
public static void setXMLMaxGeneralEntitySizeLimit(@Nullable String sMaxGeneralEntitySizeLimit)
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:
setXMLMaxGeneralEntitySizeLimit(int)
-
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
public static void setXMLMaxParameterEntitySizeLimit(@Nullable String sMaxParameterEntitySizeLimit)
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:
setXMLMaxParameterEntitySizeLimit(int)
-
getXMLMaxParameterEntitySizeLimit
public static int getXMLMaxParameterEntitySizeLimit()
-
-