Package com.dd.plist

Class ParsedObjectStack

java.lang.Object
com.dd.plist.ParsedObjectStack

class ParsedObjectStack extends Object
Keeps track of the stack of parsed objects in a binary property list.
  • Field Details

    • MAX_NESTING_DEPTH

      static final int MAX_NESTING_DEPTH
      The maximum number of nested objects that will be parsed. This protects against StackOverflowErrors 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

      static final String NESTING_DEPTH_EXCEEDED_MESSAGE
      The error message used by all parsers when MAX_NESTING_DEPTH is exceeded.
      See Also:
    • parent

      private final ParsedObjectStack parent
    • object

      private final int object
    • depth

      private final int depth
  • Constructor Details

    • ParsedObjectStack

      private ParsedObjectStack(ParsedObjectStack parent, int object)
  • Method Details

    • empty

      public static ParsedObjectStack empty()
      Creates a new stack containing only the specified object identifier.
      Returns:
      The stack.
    • push

      public ParsedObjectStack push(int obj) throws PropertyListFormatException
      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

      private void throwIfOnStack(int obj) throws PropertyListFormatException
      Throws:
      PropertyListFormatException