Class PreflightPath

java.lang.Object
org.apache.pdfbox.preflight.PreflightPath

public class PreflightPath extends Object
Contains a stack of objects to follow the validation path. Examples:
  • If the ValidationProcess computes a Type1Font, this object could contain a path like PDPage|PDResources|PDFont.
  • If the ValidationProcess computes an XObject, this object could contain a path like PDPage|PDResources|PDFontType3|PDResource|PDXObject.
  • Field Details

    • objectPath

      private final Stack objectPath
    • classObjPath

      private final Stack<Class> classObjPath
  • Constructor Details

    • PreflightPath

      public PreflightPath()
  • Method Details

    • pushObject

      public boolean pushObject(Object pathElement)
    • getPathElement

      public <T> T getPathElement(int position, Class<T> expectedType)
      Return the object at the given position. The object must be an instance of the given class.
      Parameters:
      position -
      expectedType -
      Returns:
      the object at the given position.
    • getClosestTypePosition

      public <T> int getClosestTypePosition(Class<T> type)
      Return the index of the first object that have the given type.
      Parameters:
      type -
      Returns:
      the object position, -1 if the type doesn't exist in the stack.
    • getClosestPathElement

      public <T> T getClosestPathElement(Class<T> type)
    • peek

      public Object peek()
      Looks at the object at the top of this stack without removing it from the stack.
      Returns:
      the object at the top of the stack.
    • pop

      public Object pop()
    • clear

      public void clear()
    • size

      public int size()
    • isEmpty

      public boolean isEmpty()
    • isExpectedType

      public boolean isExpectedType(Class<?> type)