示例#1
0
 /**
  * This is used to handle an operation.
  *
  * @param operator The operation to perform.
  * @param operands The list of arguments.
  * @throws IOException If there is an error processing the operation.
  */
 protected void processOperator(Operator operator, List<COSBase> operands) throws IOException {
   String name = operator.getName();
   OperatorProcessor processor = operators.get(name);
   if (processor != null) {
     processor.setContext(this);
     try {
       processor.process(operator, operands);
     } catch (IOException e) {
       operatorException(operator, operands, e);
     }
   } else {
     unsupportedOperator(operator, operands);
   }
 }
示例#2
0
 /**
  * Adds an operator processor to the engine.
  *
  * @param op operator processor
  */
 public final void addOperator(OperatorProcessor op) {
   op.setContext(this);
   operators.put(op.getName(), op);
 }
示例#3
0
 /**
  * Register a custom operator processor with the engine.
  *
  * @param operator The operator as a string.
  * @param op Processor instance.
  * @deprecated Use {@link #addOperator(OperatorProcessor)} instead
  */
 @Deprecated
 public void registerOperatorProcessor(String operator, OperatorProcessor op) {
   op.setContext(this);
   operators.put(operator, op);
 }