Class StubOperator


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

      • name

        private final java.lang.String name
      • CHECK_NO_OPERANDS

        private static final java.util.List<java.lang.String> CHECK_NO_OPERANDS
      • CHECK_STRING_OPERANDS

        private static final java.util.List<java.lang.String> CHECK_STRING_OPERANDS
      • CHECK_TAG_AND_PROPERTY_OPERANDS

        private static final java.util.List<java.lang.String> CHECK_TAG_AND_PROPERTY_OPERANDS
      • CHECK_NUMBER_OPERANDS_6

        private static final java.util.List<java.lang.String> CHECK_NUMBER_OPERANDS_6
      • CHECK_NUMBER_OPERANDS_4

        private static final java.util.List<java.lang.String> CHECK_NUMBER_OPERANDS_4
      • CHECK_NUMBER_OPERANDS_2

        private static final java.util.List<java.lang.String> CHECK_NUMBER_OPERANDS_2
      • CHECK_NUMBER_OPERANDS

        private static final java.util.List<java.lang.String> CHECK_NUMBER_OPERANDS
      • CHECK_ARRAY_OPERANDS

        private static final java.util.List<java.lang.String> CHECK_ARRAY_OPERANDS
    • Constructor Detail

      • StubOperator

        public StubOperator​(java.lang.String name)
    • Method Detail

      • process

        public void process​(Operator operator,
                            java.util.List<COSBase> arguments)
                     throws java.io.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:
        java.io.IOException - if the operator cannot be processed
      • checkNoOperands

        private void checkNoOperands​(java.util.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​(java.util.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​(java.util.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​(java.util.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​(java.util.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​(java.lang.String errorCode,
                                                        java.lang.String details)
        Create a ContentStreamException with ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT.
        Returns:
        the ContentStreamException created.