|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.process.internal.Stages
public final class Stages
A stage-related collection of utility methods.
| Method Summary | ||
|---|---|---|
static LinearAcceptor.Builder |
acceptingChain(ChainableAcceptor rootStage)
Start building a linear accepting chain. |
|
static LinearAcceptor.Builder |
acceptingChain(com.google.common.base.Function<Request,Request> transformation)
Start building a linear accepting chain. |
|
static TreeAcceptor.Builder |
acceptingTree(com.google.common.base.Function<Request,Request> transformation)
Start building a hierarchical accepting tree. |
|
static LinearAcceptor |
asLinearAcceptor(Inflector<Request,Response> inflector)
Creates a terminal LinearAcceptor that implements Inflecting
interface and returns the provided Inflector instance
when the Inflecting.inflector() method is called. |
|
static TreeAcceptor |
asTreeAcceptor(Inflector<Request,Response> inflector)
Creates a leaf-node TreeAcceptor that implements Inflecting
interface and returns the provided Inflector instance
when the Inflecting.inflector() method is called. |
|
static
|
extractInflector(java.lang.Object stage)
(Optionally) extracts an inflector from a processing stage,
provided the stage implements Inflecting interface. |
|
static Responder.Builder |
respondingChain(com.google.common.base.Function<Response,Response> transformation)
Start building a linear accepting chain. |
|
static Pair<Request,java.util.Iterator<TreeAcceptor>> |
singletonTreeContinuation(Request request,
TreeAcceptor nextAcceptor)
Create a hierarchical continuation with the supplied request on the left side of the continuation and a singleton iterator containing the single next stage on the right side of the continuation. |
|
static Pair<Request,com.google.common.base.Optional<LinearAcceptor>> |
terminalLinearContinuation(Request request)
Create a terminal linear continuation with the supplied request on the left side of the continuation. |
|
static Pair<Request,java.util.Iterator<TreeAcceptor>> |
terminalTreeContinuation(Request request)
Create a terminal hierarchical continuation with the supplied request on the left side of the continuation. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Pair<Request,java.util.Iterator<TreeAcceptor>> terminalTreeContinuation(Request request)
request - transformed request to be returned as part of the terminal
continuation.
public static Pair<Request,java.util.Iterator<TreeAcceptor>> singletonTreeContinuation(Request request,
TreeAcceptor nextAcceptor)
request - transformed request to be returned as part of the terminal
continuation.nextAcceptor - next tree acceptor stage.
public static Pair<Request,com.google.common.base.Optional<LinearAcceptor>> terminalLinearContinuation(Request request)
request - transformed request to be returned as part of the terminal
continuation.
public static TreeAcceptor asTreeAcceptor(Inflector<Request,Response> inflector)
TreeAcceptor that implements Inflecting
interface and returns the provided Inflector instance
when the Inflecting.inflector() method is called.
TreeAcceptor.apply(javax.ws.rs.core.Request) method of the created
hierarchical acceptor returns the unchanged request and an empty
continuation iterator.
inflector - a request to response transformation to be wrapped in an
TreeAcceptor instance.
TreeAcceptor that wraps the supplied Inflector.public static LinearAcceptor asLinearAcceptor(Inflector<Request,Response> inflector)
LinearAcceptor that implements Inflecting
interface and returns the provided Inflector instance
when the Inflecting.inflector() method is called.
LinearAcceptor.apply(javax.ws.rs.core.Request) method of the created
linear acceptor returns the unchanged supplied request and a continuation
referring to an absent next linear acceptor.
inflector - a request to response transformation to be wrapped in an
TreeAcceptor instance.
TreeAcceptor that wraps the supplied Inflector.public static <DATA,RESULT> com.google.common.base.Optional<Inflector<DATA,RESULT>> extractInflector(java.lang.Object stage)
inflector from a processing stage,
provided the stage implements Inflecting interface. Otherwise method
returns an absent inflector.
DATA - data type transformable by the stage and returned inflector.RESULT - type of result produced by a successful inflector data transformation.stage - a stage to extract the inflector from.
absent inflector
otherwise.public static TreeAcceptor.Builder acceptingTree(com.google.common.base.Function<Request,Request> transformation)
transformation - root transformation function.
public static LinearAcceptor.Builder acceptingChain(com.google.common.base.Function<Request,Request> transformation)
transformation - root transformation function.
public static LinearAcceptor.Builder acceptingChain(ChainableAcceptor rootStage)
rootStage - root chainable linear stage.
public static Responder.Builder respondingChain(com.google.common.base.Function<Response,Response> transformation)
transformation - root transformation function.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||