Class StubOperator

java.lang.Object
org.apache.pdfbox.contentstream.operator.OperatorProcessor
org.apache.pdfbox.preflight.content.StubOperator

public class StubOperator extends OperatorProcessor
This implementation of OperatorProcessor allow the operator validation according PDF/A rules without compute the operator actions.
  • Field Details

    • name

      private final String name
    • CHECK_NO_OPERANDS

      private static final List<String> CHECK_NO_OPERANDS
    • CHECK_STRING_OPERANDS

      private static final List<String> CHECK_STRING_OPERANDS
    • CHECK_TAG_AND_PROPERTY_OPERANDS

      private static final List<String> CHECK_TAG_AND_PROPERTY_OPERANDS
    • CHECK_NUMBER_OPERANDS_6

      private static final List<String> CHECK_NUMBER_OPERANDS_6
    • CHECK_NUMBER_OPERANDS_4

      private static final List<String> CHECK_NUMBER_OPERANDS_4
    • CHECK_NUMBER_OPERANDS_2

      private static final List<String> CHECK_NUMBER_OPERANDS_2
    • CHECK_NUMBER_OPERANDS

      private static final List<String> CHECK_NUMBER_OPERANDS
    • CHECK_ARRAY_OPERANDS

      private static final List<String> CHECK_ARRAY_OPERANDS
  • Constructor Details

    • StubOperator

      public StubOperator(String name)
  • Method Details

    • process

      public void process(Operator operator, List<COSBase> arguments) throws IOException
      Description copied from class: OperatorProcessor
      Process the operator.
      Specified by:
      process in class OperatorProcessor
      Parameters:
      operator - the operator to process
      arguments - the operands to use when processing
      Throws:
      IOException - if the operator cannot be processed
    • checkNoOperands

      private void checkNoOperands(List<COSBase> arguments) throws ContentStreamException
      If the arguments list of Operator isn't empty, this method throws a ContentStreamException.
      Parameters:
      arguments -
      Throws:
      ContentStreamException
    • checkStringOperands

      private void checkStringOperands(List<COSBase> arguments, int length) throws ContentStreamException
      If the arguments list of Operator doesn't have String parameter, this method throws a ContentStreamException.
      Parameters:
      arguments -
      length -
      Throws:
      ContentStreamException
    • checkArrayOperands

      private void checkArrayOperands(List<COSBase> arguments, int length) throws ContentStreamException
      If the arguments list of Operator doesn't have Array parameter, this method throws a ContentStreamException.
      Parameters:
      arguments -
      length -
      Throws:
      ContentStreamException
    • checkNumberOperands

      private void checkNumberOperands(List<COSBase> arguments, int length) throws ContentStreamException
      If the arguments list of Operator doesn't have Number parameters (Int, float...), this method throws a ContentStreamException.
      Parameters:
      arguments - the arguments list to check
      length - the expected size of the list
      Throws:
      ContentStreamException
    • checkTagAndPropertyOperands

      private void checkTagAndPropertyOperands(List<COSBase> arguments) throws ContentStreamException
      The given arguments list is valid only if the first argument is a Tag (A String) and if the second argument is a String or a Dictionary
      Parameters:
      arguments -
      Throws:
      ContentStreamException
    • createInvalidArgumentsError

      private ContentStreamException createInvalidArgumentsError()
      Create a ContentStreamException with ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT.
      Returns:
      the ContentStreamException created.
    • createLimitError

      private ContentStreamException createLimitError(String errorCode, String details)
      Create a ContentStreamException with ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT.
      Returns:
      the ContentStreamException created.
    • getName

      public String getName()
      Description copied from class: OperatorProcessor
      Returns the name of this operator, e.g. "BI".
      Specified by:
      getName in class OperatorProcessor