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 Details

    • SYSTEM_PROPERTY_JDX_XML_ENTITY_EXPANSION_LIMIT

      public static final String SYSTEM_PROPERTY_JDX_XML_ENTITY_EXPANSION_LIMIT
      See Also:
    • SYSTEM_PROPERTY_ENTITY_EXPANSION_LIMIT

      public static final String SYSTEM_PROPERTY_ENTITY_EXPANSION_LIMIT
      See Also:
    • SYSTEM_PROPERTY_JDX_XML_ELEMENT_ATTRIBUTE_LIMIT

      public static final String SYSTEM_PROPERTY_JDX_XML_ELEMENT_ATTRIBUTE_LIMIT
      See Also:
    • SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT

      public static final String SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT
      See Also:
    • SYSTEM_PROPERTY_JDX_XML_MAX_OCCUR

      public static final String SYSTEM_PROPERTY_JDX_XML_MAX_OCCUR
      See Also:
    • SYSTEM_PROPERTY_MAX_OCCUR

      public static final String SYSTEM_PROPERTY_MAX_OCCUR
      See Also:
    • SYSTEM_PROPERTY_JDX_XML_TOTAL_ENTITY_SIZE_LIMIT

      public static final String SYSTEM_PROPERTY_JDX_XML_TOTAL_ENTITY_SIZE_LIMIT
      See Also:
    • SYSTEM_PROPERTY_JDX_XML_MAX_GENERAL_ENTITY_SIZE_LIMIT

      public static final String SYSTEM_PROPERTY_JDX_XML_MAX_GENERAL_ENTITY_SIZE_LIMIT
      See Also:
    • SYSTEM_PROPERTY_JDX_XML_MAX_PARAMETER_ENTITY_SIZE_LIMIT

      public static final String 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

      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. null means the property is deleted
    • setXMLEntityExpansionLimitIfLarger

      public static void setXMLEntityExpansionLimitIfLarger(int nMaxOccur)
      The same as setXMLEntityExpansionLimit(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

      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. null means the property is deleted
      Since:
      8.6.2
    • setXMLElementAttributeLimitIfLarger

      public static void setXMLElementAttributeLimitIfLarger(int nElementAttributeLimit)
      The same as setXMLElementAttributeLimit(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

      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. null means the property is deleted.
      Since:
      8.6.2
    • setXMLMaxOccurIfLarger

      public static void setXMLMaxOccurIfLarger(int nMaxOccur)
      The same as setXMLMaxOccur(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

      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. null means the property is deleted.
      Since:
      8.6.2
    • setXMLTotalEntitySizeLimitIfLarger

      public static void setXMLTotalEntitySizeLimitIfLarger(int nTotalEntitySizeLimit)
      The same as setXMLTotalEntitySizeLimit(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

      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. null means the property is deleted.
      Since:
      8.6.2
    • setXMLMaxGeneralEntitySizeLimitIfLarger

      public static void setXMLMaxGeneralEntitySizeLimitIfLarger(int nMaxGeneralEntitySizeLimit)
      The same as setXMLMaxGeneralEntitySizeLimit(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

      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. null means the property is deleted.
      Since:
      8.6.2
    • setXMLMaxParameterEntitySizeLimitIfLarger

      public static void setXMLMaxParameterEntitySizeLimitIfLarger(int nMaxParameterEntitySizeLimit)
      The same as setXMLMaxParameterEntitySizeLimit(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()