com.github.fge.jsonschema.core.processing
Class RawProcessor<IN,OUT>

java.lang.Object
  extended by com.github.fge.jsonschema.core.processing.RawProcessor<IN,OUT>
Type Parameters:
IN - type of input
OUT - type of output
All Implemented Interfaces:
Processor<ValueHolder<IN>,ValueHolder<OUT>>
Direct Known Subclasses:
RefResolver, SyntaxProcessor

public abstract class RawProcessor<IN,OUT>
extends Object
implements Processor<ValueHolder<IN>,ValueHolder<OUT>>

Processor wrapper class

This class allows to declare a Processor with "raw" types, that is inputs and outputs which do not implement MessageProvider. Inputs and outputs are automatically wrapped into a ValueHolder.

Implementations of this class are only required to provide a name by which the input and output will be identified in a processing message.


Constructor Summary
protected RawProcessor(String inputName, String outputName)
          Protected constructor
 
Method Summary
protected  ProcessingMessage newMessage(IN rawInput)
          Create a new processing message for reporting purposes
 ValueHolder<OUT> process(ProcessingReport report, ValueHolder<IN> input)
          Process the input
protected abstract  OUT rawProcess(ProcessingReport report, IN input)
          Process a raw input, return a raw output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawProcessor

protected RawProcessor(String inputName,
                       String outputName)
Protected constructor

Parameters:
inputName - name of the input
outputName - name of the output
Method Detail

rawProcess

protected abstract OUT rawProcess(ProcessingReport report,
                                  IN input)
                           throws ProcessingException
Process a raw input, return a raw output

Parameters:
report - the report to use
input - the raw input
Returns:
the raw output
Throws:
ProcessingException - processing failure
See Also:
newMessage(Object)

process

public final ValueHolder<OUT> process(ProcessingReport report,
                                      ValueHolder<IN> input)
                               throws ProcessingException
Description copied from interface: Processor
Process the input

Specified by:
process in interface Processor<ValueHolder<IN>,ValueHolder<OUT>>
Parameters:
report - the report to use while processing
input - the input for this processor
Returns:
the output
Throws:
ProcessingException - processing failed

newMessage

protected final ProcessingMessage newMessage(IN rawInput)
Create a new processing message for reporting purposes

Parameters:
rawInput - the raw input
Returns:
a new message