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

public final Class XMLLimitAnalyzer

extends Object
Class Inheritance
Imports
java.util.Formatter, .HashMap, .Map, jdk.xml.internal.XMLSecurityManager.Limit

A helper for analyzing entity expansion limits

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
XMLLimitAnalyzer.NameMap

Map old property names with the new ones

Field Summary

Modifier and TypeField and Description
private final Map<String, Integer>[]
caches

Maintain values of the top 10 elements in the process of parsing

private String
private String
private final String[]
names

Names of the entities corresponding to their max values

private final int[]
totalValue

Total value of accumulated entities

private final int[]
values

Max value accumulated for each property

Constructor Summary

AccessConstructor and Description
public
XMLLimitAnalyzer()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public void
addValue(XMLSecurityManager.Limit
the type of the property
limit
,
String
the name of the entity
entityName
,
int
the value of the entity
value
)

Add the value to the current max count for the specified property To find the max value of all entities, set no limit

public void
addValue(int
the index of the property
index
,
String
the name of the entity
entityName
,
int
the value of the entity
value
)

Add the value to the current count by the index of the property

public void
debugPrint(XMLSecurityManager securityManager)

public void
endEntity(XMLSecurityManager.Limit
the limit property
limit
,
String
the name of an entity
name
)

Stop tracking the entity

public int

Returns:

the accumulated value of the property
getTotalValue
(XMLSecurityManager.Limit
the property
limit
)

Return the total value accumulated so far

public int
getTotalValue(int index)

public int

Returns:

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

Return the value of the current max count for the specified property

public int
getValue(int index)

public int

Returns:

count of a property
getValueByIndex
(int
the index of a property
index
)

Return the current max value (count or length) by the index of a property

public boolean
public void
reset(XMLSecurityManager.Limit
The limit to be reset.
limit
)

Resets the current value of the specified limit.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachesback to summary
private final Map<String, Integer>[] caches

Maintain values of the top 10 elements in the process of parsing

entityEndback to summary
private String entityEnd
entityStartback to summary
private String entityStart
namesback to summary
private final String[] names

Names of the entities corresponding to their max values

totalValueback to summary
private final int[] totalValue

Total value of accumulated entities

valuesback to summary
private final int[] values

Max value accumulated for each property

Constructor Detail

XMLLimitAnalyzerback to summary
public XMLLimitAnalyzer()

Default constructor. Establishes default values for known security vulnerabilities.

Annotations
@SuppressWarnings:rawtypes, unchecked

Method Detail

addValueback to summary
public void addValue(XMLSecurityManager.Limit limit, String entityName, int value)

Add the value to the current max count for the specified property To find the max value of all entities, set no limit

Parameters
limit:XMLSecurityManager.Limit

the type of the property

entityName:String

the name of the entity

value:int

the value of the entity

addValueback to summary
public void addValue(int index, String entityName, int value)

Add the value to the current count by the index of the property

Parameters
index:int

the index of the property

entityName:String

the name of the entity

value:int

the value of the entity

debugPrintback to summary
public void debugPrint(XMLSecurityManager securityManager)
endEntityback to summary
public void endEntity(XMLSecurityManager.Limit limit, String name)

Stop tracking the entity

Parameters
limit:XMLSecurityManager.Limit

the limit property

name:String

the name of an entity

getTotalValueback to summary
public int getTotalValue(XMLSecurityManager.Limit limit)

Return the total value accumulated so far

Parameters
limit:XMLSecurityManager.Limit

the property

Returns:int

the accumulated value of the property

getTotalValueback to summary
public int getTotalValue(int index)
getValueback to summary
public int getValue(XMLSecurityManager.Limit limit)

Return the value of the current max count for the specified property

Parameters
limit:XMLSecurityManager.Limit

the property

Returns:int

the value of the property

getValueback to summary
public int getValue(int index)
getValueByIndexback to summary
public int getValueByIndex(int index)

Return the current max value (count or length) by the index of a property

Parameters
index:int

the index of a property

Returns:int

count of a property

isTrackingback to summary
public boolean isTracking(String name)
resetback to summary
public void reset(XMLSecurityManager.Limit limit)

Resets the current value of the specified limit.

Parameters
limit:XMLSecurityManager.Limit

The limit to be reset.

startEntityback to summary
public void startEntity(String name)
jdk.xml.internal back to summary

public final Enum XMLLimitAnalyzer.NameMap

extends Enum<XMLLimitAnalyzer.NameMap>
Class Inheritance

Map old property names with the new ones

Field Summary

Modifier and TypeField and Description
public static final XMLLimitAnalyzer.NameMap
public static final XMLLimitAnalyzer.NameMap
public static final XMLLimitAnalyzer.NameMap
pack-priv final String
pack-priv final String

Constructor Summary

AccessConstructor and Description
private
NameMap(String newName, String oldName)

Method Summary

Modifier and TypeMethod and Description
pack-priv String
getOldName(String newName)

public static XMLLimitAnalyzer.NameMap
public static XMLLimitAnalyzer.NameMap[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ELEMENT_ATTRIBUTE_LIMITback to summary
public static final XMLLimitAnalyzer.NameMap ELEMENT_ATTRIBUTE_LIMIT
ENTITY_EXPANSION_LIMITback to summary
public static final XMLLimitAnalyzer.NameMap ENTITY_EXPANSION_LIMIT
MAX_OCCUR_NODE_LIMITback to summary
public static final XMLLimitAnalyzer.NameMap MAX_OCCUR_NODE_LIMIT
newNameback to summary
pack-priv final String newName
oldNameback to summary
pack-priv final String oldName

Constructor Detail

NameMapback to summary
private NameMap(String newName, String oldName)

Method Detail

getOldNameback to summary
pack-priv String getOldName(String newName)
valueOfback to summary
public static XMLLimitAnalyzer.NameMap valueOf(String name)
valuesback to summary
public static XMLLimitAnalyzer.NameMap[] values()