Package com.dd.plist
Class ParsedObjectStack
java.lang.Object
com.dd.plist.ParsedObjectStack
Keeps track of the stack of parsed objects in a binary property list.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int(package private) static final intThe maximum number of nested objects that will be parsed.(package private) static final StringThe error message used by all parsers whenMAX_NESTING_DEPTHis exceeded.private final intprivate final ParsedObjectStack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ParsedObjectStackempty()Creates a new stack containing only the specified object identifier.push(int obj) Tries to push the specified object identifier onto the stack, checking that it is not already on the stack and that the maximum nesting depth has not been exceeded.private voidthrowIfOnStack(int obj)
-
Field Details
-
MAX_NESTING_DEPTH
static final int MAX_NESTING_DEPTHThe maximum number of nested objects that will be parsed. This protects againstStackOverflowErrors caused by excessively (or maliciously) nested structures, while still allowing very deeply nested legitimate property lists to be parsed.- See Also:
-
NESTING_DEPTH_EXCEEDED_MESSAGE
The error message used by all parsers whenMAX_NESTING_DEPTHis exceeded.- See Also:
-
parent
-
object
private final int object -
depth
private final int depth
-
-
Constructor Details
-
ParsedObjectStack
-
-
Method Details
-
empty
Creates a new stack containing only the specified object identifier.- Returns:
- The stack.
-
push
Tries to push the specified object identifier onto the stack, checking that it is not already on the stack and that the maximum nesting depth has not been exceeded.- Parameters:
obj- The object identifier.- Returns:
- The new stack with the added object identifier.
- Throws:
PropertyListFormatException- The stack already contained that object identifier (indicating a cyclic reference), or the maximum nesting depth was exceeded.
-
throwIfOnStack
- Throws:
PropertyListFormatException
-