APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.xml.internal

public final Class XMLSecurityManager

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
com.sun.org.apache.xerces.internal.util.SecurityManager, java.util.Collections, .HashMap, .Map, .Objects, java.util.concurrent.CopyOnWriteArrayList, java.util.stream.Collectors, javax.xml.catalog.CatalogManager, .CatalogResolver, .CatalogResolver.NotFoundAction, javax.xml.stream.XMLInputFactory, jdk.xml.internal.JdkProperty.State, .JdkProperty.ImplPropMap, org.xml.sax.SAXException

This class manages standard and implementation-specific limitations.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
XMLSecurityManager.BooleanMapper

Represents a mapper for properties of type Boolean.

public static class
XMLSecurityManager.IntegerMapper

Represents a mapper for properties of type Integer.

public static enum
XMLSecurityManager.Limit

Limits managed by the security manager

public static enum
XMLSecurityManager.Processor

Supported processors

public static class
XMLSecurityManager.StringMapper

Represents a mapper for properties of type String.

public abstract static class
XMLSecurityManager.ValueMapper

Represents a mapper of property values between int and other types, such as Boolean, String, and Object.

public abstract class
XMLSecurityManager.ValueMapper1<
the value type to be mapped with an int value
T
>

Represents a mapper of property values between int and other types, such as Boolean, String, and Object.

Field Summary

Modifier and TypeField and Description
private static final XMLSecurityManager.BooleanMapper
pack-priv static final Map<String, Integer>
private static final XMLSecurityManager.StringMapper
public static final String
public static final String
public static final String
public static final String
public static final String
pack-priv static final Map<String, Integer>
private static final XMLSecurityManager.StringMapper
public static final String
private final int
indexEntityCountInfo

Index of the special entityCountInfo property

private static final XMLSecurityManager.IntegerMapper
private boolean[]
isSet

States that determine if properties are set explicitly

public static final String
private static final int
private static final CopyOnWriteArrayList<String>
private String
pack-priv boolean
secureProcessing

Flag indicating if secure processing is set

pack-priv boolean
secureProcessingSet

Flag indicating the secure processing is set explicitly through factories' setFeature method and then the setSecureProcessing method

private JdkProperty.State[]
states

States of the settings for each property

private int[]
values

Values of the properties

public static final String

Constructor Summary

AccessConstructor and Description
public
XMLSecurityManager()

Default constructor.

public
XMLSecurityManager(boolean secureProcessing)

Instantiate Security Manager in accordance with the status of secure processing

Method Summary

Modifier and TypeMethod and Description
public XMLSecurityManager

Returns:

a copy of the XMLSecurityManager
clone
()

Overrides java.lang.Object.clone.

Returns a copy of the XMLSecurityManager.

public XMLSecurityManager

Returns:

a copy of the XMLSecurityManager
cloneAndUpdate
()

Returns a copy of the XMLSecurityManager that is updated with the current System Properties.

public static XMLSecurityManager

Returns:

an instance of the new security manager XMLSecurityManager
convert
(Object
user specified security manager
value
,
XMLSecurityManager
an instance of XMLSecurityManager
securityManager
)

Convert a value set through setProperty to XMLSecurityManager.

public void
public String

Returns:

the limit's new name if found, null otherwise
find
(String
the property name specified
propertyName
)

Finds a limit's new name with the given property name.

public XMLSecurityManager.Limit

Returns:

the enum value if found; null otherwise
getEnumValue
(String
property name
propertyName
)

Returns the enum value by its property name.

public int

Returns:

the index of the property if found; return -1 if not
getIndex
(String
property name
propertyName
)

Get the index by property name

public CatalogResolver

Returns:

the JDKCatalogResolver
getJDKCatalogResolver
()

Returns the JDKCatalogResolver with the current setting of the RESOLVE property.

public int

Returns:

the value of the property
getLimit
(XMLSecurityManager.Limit
the property
limit
)

Return the value of the specified property

public String

Returns:

the value of the property as a string. If a property is managed by this manager, its value shall not be null.
getLimitAsString
(String
the property name
propertyName
)

Return the value of the specified property

public String

Returns:

value of a property
getLimitValueAsString
(XMLSecurityManager.Limit
the property
limit
)

Return the value of a property by its ordinal

public String

Returns:

limit of a property as a string
getLimitValueByIndex
(int
the index of a property
index
)

Return the value of a property by its ordinal

private boolean
getPropertyConfig(XMLSecurityManager.Limit
the limit property
limit
,
String
the name of system property
sysPropertyName
)

Reads a property from a configuration file, if any.

public JdkProperty.State

Returns:

the state of the limit property
getState
(XMLSecurityManager.Limit
the limit
limit
)

Return the state of the limit property

public String

Returns:

the state of the limit property
getStateLiteral
(XMLSecurityManager.Limit
the limit
limit
)

Return the state of the limit property

private boolean
getSystemProperty(XMLSecurityManager.Limit
the limit property
limit
,
String
the name of system property
sysPropertyName
)

Reads a system property, sets value and state if found.

public boolean

Returns:

true if the Limit is set and the values match
is
(XMLSecurityManager.Limit
the Limit
limit
,
int
the value
value
)

Checks whether the specified Limit is set and the value is as specified.

public boolean

Returns:

true if the Limit is set and the value is 1
is
(XMLSecurityManager.Limit
the Limit
limit
)

Checks whether the specified Limit is set and the value is 1 (true for a property of boolean type).

public boolean
isNoLimit(int limit)

Check if there's no limit defined by the Security Manager

public boolean

Returns:

true if the size is over the limit, false otherwise
isOverLimit
(XMLSecurityManager.Limit
the type of the limit property
limit
,
String
the name of the entity
entityName
,
int
the size (count or length) of the entity
size
,
XMLLimitAnalyzer limitAnalyzer)

Check if the size (length or count) of the specified limit property is over the limit

public boolean

Returns:

true if the size is over the limit, false otherwise
isOverLimit
(int
the index of the limit property
index
,
String
the name of the entity
entityName
,
int
the size (count or length) of the entity
size
,
XMLLimitAnalyzer limitAnalyzer)

Check if the value (length or count) of the specified limit property is over the limit

public boolean

Returns:

true if the size is over the limit, false otherwise
isOverLimit
(XMLSecurityManager.Limit
the type of the limit property
limit
,
XMLLimitAnalyzer limitAnalyzer)

Check against cumulated value

public boolean
isOverLimit(int index, XMLLimitAnalyzer limitAnalyzer)

public boolean

Returns:

the state of secure processing
isSecureProcessing
()

Return the state of secure processing

public boolean

Returns:

the state indicating whether the Secure Processing is set explicitly
isSecureProcessingSet
()

Returns the state indicating whether the Secure Processing is set explicitly, via factories' setFeature and then this class' setSecureProcessing method.

public boolean

Returns:

true if the limit is set, false otherwise
isSet
(XMLSecurityManager.Limit
the limit
limit
)

Indicate if a property is set explicitly

public boolean
public static void
printWarning(String
the name of the parser class
parserClassName
,
String
the property name
propertyName
,
SAXException
the exception thrown by the parser
exception
)

Prints out warnings if a parser does not support the specified feature/property.

public void
readSystemProperties()

Read system properties, or the configuration file

public boolean

Returns:

true if the property is managed by the security manager; false if otherwise.
setLimit
(String
property name
propertyName
,
JdkProperty.State
the state of the property
state
,
Object
the value of the property
value
)

Set limit by property name and state

public void
setLimit(XMLSecurityManager.Limit
the limit
limit
,
JdkProperty.State
the state of the property
state
,
int
the value of the property
value
)

Set the value for a specific limit.

public void
setLimit(XMLSecurityManager.Limit
the limit
limit
,
JdkProperty.State
the state of the property
state
,
Object
the value of the property
value
)

Sets the value of a property by its enum name

public void
setLimit(int
the index of the property
index
,
JdkProperty.State
the state of the property
state
,
int
the value of the property
value
)

Set the value of a property by its index

public void
setSecureProcessing(boolean secure)

Setting FEATURE_SECURE_PROCESSING explicitly

private CatalogResolver.NotFoundAction
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait