Class PreflightPath


  • public class PreflightPath
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Stack<java.lang.Class> classObjPath  
      private java.util.Stack objectPath  
    • Constructor Summary

      Constructors 
      Constructor Description
      PreflightPath()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      <T> T getClosestPathElement​(java.lang.Class<T> type)  
      <T> int getClosestTypePosition​(java.lang.Class<T> type)
      Return the index of the first object that have the given type.
      <T> T getPathElement​(int position, java.lang.Class<T> expectedType)
      Return the object at the given position.
      boolean isEmpty()  
      boolean isExpectedType​(java.lang.Class<?> type)  
      java.lang.Object peek()
      Looks at the object at the top of this stack without removing it from the stack.
      java.lang.Object pop()  
      boolean pushObject​(java.lang.Object pathElement)  
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • objectPath

        private final java.util.Stack objectPath
      • classObjPath

        private final java.util.Stack<java.lang.Class> classObjPath
    • Constructor Detail

      • PreflightPath

        public PreflightPath()
    • Method Detail

      • pushObject

        public boolean pushObject​(java.lang.Object pathElement)
      • getPathElement

        public <T> T getPathElement​(int position,
                                    java.lang.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​(java.lang.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​(java.lang.Class<T> type)
      • peek

        public java.lang.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 java.lang.Object pop()
      • clear

        public void clear()
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • isExpectedType

        public boolean isExpectedType​(java.lang.Class<?> type)