<p>
Unwraps a wrapped implementation of {@link IProcessingInstructionProcessor}.
</p>
<p>
This method is meant for <strong>internal</strong> use only.
</p>

@param processor the processor to be unwrapped.
@return the unwrapped processor.
162047
public static IProcessingInstructionProcessor unwrap(final IProcessingInstructionProcessor processor) {
        if (processor == null) {
            return null;
        }
        if (processor instanceof AbstractProcessorWrapper) {
            return (IProcessingInstructionProcessor)((AbstractProcessorWrapper) processor).unwrap();
        }
        return processor;
    }
574603
public function process($processor) {
        if (!$processor instanceof base_processor) { // No correct processor, throw exception
            throw new base_element_struct_exception('incorrect_processor');
        }

        $iterator = $this->get_iterator($processor); // Get the iterator over backup-able data

        foreach ($iterator as $key => $values) { // Process each "ocurrrence" of the nested element (recordset or array)

            // Fill the values of the attributes and final elements with the $values from the iterator
            $this->fill_values($values);

            // Perform pre-process tasks for the nested_element
            $processor->pre_process_nested_element($this);

            // Delegate the process of each attribute
            foreach ($this->get_attributes() as $attribute) {
                $attribute->process($processor);
            }

            // Main process tasks for the nested element, once its attributes have been processed
            $processor->process_nested_element($this);

            // Delegate the process of each final_element
            foreach ($this->get_final_elements() as $final_element) {
                $final_element->process($processor);
            }

            // Delegate the process to the optigroup
            if ($this->get_optigroup()) {
                $this->get_optigroup()->process($processor);
            }

            // Delegate the process to each child nested_element
            foreach ($this->get_children() as $child) {
                $child->process($processor);
            }

            // Perform post-process tasks for the nested element
            $processor->post_process_nested_element($this);

            // Everything processed, clean values before next iteration
            $this->clean_values();

            // Increment counter for this element
            $this->counter++;

            // For root element, check we only have 1 element
            if ($this->get_parent() === null && $this->counter > 1) {
                throw new base_element_struct_exception('root_only_one_ocurrence', $this->get_name());
            }
        }
        // Close the iterator (DB recordset / array iterator)
        $iterator->close();
    }
1260531
@Override
	protected AbstractChainedGlobalProcessor<GlobalPostProcessingContext> buildProcessorByKey(String key) {

		AbstractChainedGlobalProcessor<GlobalPostProcessingContext> processor = null;

		if (key.equals(JawrConstant.GLOBAL_GOOGLE_CLOSURE_POSTPROCESSOR_ID)) {
			processor = new ClosureGlobalPostProcessor();
		}

		return processor;
	}
662783
@Override
	public Processor newProcessor(Processor p) {
		AMRDefaultRuleProcessor oldProcessor = (AMRDefaultRuleProcessor) p;
		Builder builder = new Builder(oldProcessor);
		AMRDefaultRuleProcessor newProcessor = builder.build();
		newProcessor.resultStream = oldProcessor.resultStream;
		newProcessor.ruleStream = oldProcessor.ruleStream;
		return newProcessor;
	}
99399
public EventHandlerGroup<T> and(final EventProcessor... processors)
    {
        Sequence[] combinedSequences = new Sequence[sequences.length + processors.length];

        for (int i = 0; i < processors.length; i++)
        {
            consumerRepository.add(processors[i]);
            combinedSequences[i] = processors[i].getSequence();
        }
        System.arraycopy(sequences, 0, combinedSequences, processors.length, sequences.length);

        return new EventHandlerGroup<>(disruptor, consumerRepository, combinedSequences);
    }
918529
public static ITemplateBoundariesProcessor unwrap(final ITemplateBoundariesProcessor processor) {
        if (processor == null) {
            return null;
        }
        if (processor instanceof AbstractProcessorWrapper) {
            return (ITemplateBoundariesProcessor)((AbstractProcessorWrapper) processor).unwrap();
        }
        return processor;
    }
956224
public static <T, E extends Throwable> @NonNull Consumer<T> unwrappingRethrowConsumer(final @NonNull ThrowingConsumer<T, E> consumer) {
    return input -> {
      try {
        consumer.throwingAccept(input);
      } catch(final Throwable t) {
        throw rethrow(unwrap(t));
      }
    };
  }
345065
@SuppressWarnings({ "rawtypes", "unchecked" })
    public static PackagingProcessor<? extends Archive<?>> find(
            final PackagingType packagingType) {

        ServiceRegistry registry = ServiceRegistry.getInstance();
        Collection<PackagingProcessor> processors = registry.all(PackagingProcessor.class);

        StringBuilder unsupportedFormatMessage = new StringBuilder("No packaging processor for ")
                .append(packagingType.toString()).append(
                        " packaging was found. Supported processors are: ");

        for (PackagingProcessor processor : processors) {
            if (processor.handles(packagingType)) {
                // unchecked cast
                return (PackagingProcessor<? extends Archive<?>>) processor;
            }
            unsupportedFormatMessage.append(processor.getClass()).append(", ");
        }
        // trim
        if (unsupportedFormatMessage.indexOf(", ") != -1) {
            unsupportedFormatMessage.delete(unsupportedFormatMessage.length() - 2, unsupportedFormatMessage.length());
        }

        throw new UnsupportedOperationException(unsupportedFormatMessage.toString());
    }
285468
@Override
	public GlobalProcessor<T> buildProcessorChain(String processorKeys) {

		if (null == processorKeys)
			return null;
		else if (JawrConstant.EMPTY_GLOBAL_PREPROCESSOR_ID.equals(processorKeys))
			return new EmptyGlobalProcessor<>();

		StringTokenizer tk = new StringTokenizer(processorKeys, ",");

		AbstractChainedGlobalProcessor<T> chain = null;
		while (tk.hasMoreTokens())
			chain = addOrCreateChain(chain, tk.nextToken());

		return chain;
	}
721316
public static <K, V> Cache<K, V> unwrapCache(Cache<K, V> cache) {
      if (cache instanceof AbstractDelegatingCache) {
         return unwrapCache(((AbstractDelegatingCache<K, V>) cache).getDelegate());
      }
      return cache;
   }
249144
public Consumer createConsumer(Processor processor) throws Exception {
        LOG.debug(this.toString());

        ObjectHelper.notNull(this.mode, "mode");
        GpioPin pin = isAlreadyProvisioned();

        if (pin == null) {
            switch (this.mode) {
            case DIGITAL_INPUT:
                pin = getOrCreateController().provisionDigitalInputPin(getPin(), pullResistance);
                break;
            case ANALOG_INPUT:
                pin = getOrCreateController().provisionAnalogInputPin(getPin());
                break;
            case ANALOG_OUTPUT:
            case DIGITAL_OUTPUT: // PinMode.allOutput()
            case PWM_OUTPUT:
                LOG.error("Cannot create Consumer with OUTPUT Mode");
                return null;
            default:
                LOG.error("Cannot create Consumer w/o Mode");
                break;
            }

        } else {
            // enhancement we could manage several pins with one consumer
            throw new IllegalArgumentException("Cannot create twice same input pin [" + this.gpioId + "] for Consumer");
        }

        return new GPIOConsumer(this, processor, pin, state);
    }
285136
public static ICDATASectionProcessor unwrap(final ICDATASectionProcessor processor) {
        if (processor == null) {
            return null;
        }
        if (processor instanceof AbstractProcessorWrapper) {
            return (ICDATASectionProcessor)((AbstractProcessorWrapper) processor).unwrap();
        }
        return processor;
    }
98281
public static MessageBatcher createBatcher(String name,
			MessageProcessor processor) {
		MessageBatcher batcher = batcherMap.get(name);
		if (batcher == null) {
			synchronized (BatcherFactory.class) {
				batcher = batcherMap.get(name);
				if (batcher == null) {
					batcher = new MessageBatcher(name, processor);
					batcherMap.put(name, batcher);
				}
			}
		}
		return batcher;
	}
218409
public <T extends RepresentationModel<T>> T invokeProcessorsFor(T value) {

		Assert.notNull(value, "Value must not be null!");

		return invokeProcessorsFor(value, ResolvableType.forClass(value.getClass()));
	}
1167210
@Override
    public Set<IProcessor> getProcessors(String dialectPrefix) { // only once called when first access
        final Set<IProcessor> processors = createLastaProcessorsSet();
        processors.addAll(getAdditionalProcessors());
        return processors;
    }
1013716
public void addDefaultProcessor(NodeProcessor processor)
	{
		if (null == processor)
		{
			throw new IllegalArgumentException("Processor should not be null.");
		}
		getActionPool().put(NODE_NAME__DEFAULT, processor);
	}
526816
public static Throwable unwrap(@Nullable Throwable t) {
		if (t instanceof UncheckedException || t instanceof java.util.concurrent.ExecutionException
				|| t instanceof java.lang.reflect.InvocationTargetException
				|| t instanceof UndeclaredThrowableException) {
			return t.getCause();
		}

		return t;
	}