Class StubOperator
java.lang.Object
org.apache.pdfbox.contentstream.operator.OperatorProcessor
org.apache.pdfbox.preflight.content.StubOperator
This implementation of OperatorProcessor allow the operator validation according PDF/A rules without compute the
operator actions.
-
Field Summary
FieldsFields inherited from class org.apache.pdfbox.contentstream.operator.OperatorProcessor
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckArrayOperands(List<COSBase> arguments, int length) If the arguments list of Operator doesn't have Array parameter, this method throws a ContentStreamException.private voidcheckNoOperands(List<COSBase> arguments) If the arguments list of Operator isn't empty, this method throws a ContentStreamException.private voidcheckNumberOperands(List<COSBase> arguments, int length) If the arguments list of Operator doesn't have Number parameters (Int, float...), this method throws a ContentStreamException.private voidcheckStringOperands(List<COSBase> arguments, int length) If the arguments list of Operator doesn't have String parameter, this method throws a ContentStreamException.private voidcheckTagAndPropertyOperands(List<COSBase> arguments) 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 Dictionaryprivate ContentStreamExceptionCreate a ContentStreamException with ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT.private ContentStreamExceptioncreateLimitError(String errorCode, String details) Create a ContentStreamException with ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT.getName()Returns the name of this operator, e.g.voidProcess the operator.Methods inherited from class org.apache.pdfbox.contentstream.operator.OperatorProcessor
checkArrayTypesClass, getContext, setContext
-
Field Details
-
name
-
CHECK_NO_OPERANDS
-
CHECK_STRING_OPERANDS
-
CHECK_TAG_AND_PROPERTY_OPERANDS
-
CHECK_NUMBER_OPERANDS_6
-
CHECK_NUMBER_OPERANDS_4
-
CHECK_NUMBER_OPERANDS_2
-
CHECK_NUMBER_OPERANDS
-
CHECK_ARRAY_OPERANDS
-
-
Constructor Details
-
StubOperator
-
-
Method Details
-
process
Description copied from class:OperatorProcessorProcess the operator.- Specified by:
processin classOperatorProcessor- Parameters:
operator- the operator to processarguments- the operands to use when processing- Throws:
IOException- if the operator cannot be processed
-
checkNoOperands
If the arguments list of Operator isn't empty, this method throws a ContentStreamException.- Parameters:
arguments-- Throws:
ContentStreamException
-
checkStringOperands
If the arguments list of Operator doesn't have String parameter, this method throws a ContentStreamException.- Parameters:
arguments-length-- Throws:
ContentStreamException
-
checkArrayOperands
If the arguments list of Operator doesn't have Array parameter, this method throws a ContentStreamException.- Parameters:
arguments-length-- Throws:
ContentStreamException
-
checkNumberOperands
If the arguments list of Operator doesn't have Number parameters (Int, float...), this method throws a ContentStreamException.- Parameters:
arguments- the arguments list to checklength- the expected size of the list- Throws:
ContentStreamException
-
checkTagAndPropertyOperands
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
Create a ContentStreamException with ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT.- Returns:
- the ContentStreamException created.
-
createLimitError
Create a ContentStreamException with ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT.- Returns:
- the ContentStreamException created.
-
getName
Description copied from class:OperatorProcessorReturns the name of this operator, e.g. "BI".- Specified by:
getNamein classOperatorProcessor
-