org.apache.pdfbox.preflight

## 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.

### Constructor Summary

Constructors
Constructor and Description
`PreflightPath()`

### Method Summary

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

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PreflightPath

    public PreflightPath()

### Method Detail

#### 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)