|
||||||||||
| 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.
| Nested Class Summary | |
|---|---|
static class |
Stages.LinkedStage<DATA>
Linked linear stage implementation. |
| Method Summary | ||
|---|---|---|
static
|
asStage(Inflector<DATA,RESULT> inflector)
Creates a terminal Stages.LinkedStage that implements Inflecting
interface and returns the provided Inflector instance
when the Inflecting.inflector() method is called. |
|
static
|
chain(ChainableStage<DATA> rootStage)
Start building a stage chain. |
|
static
|
chain(com.google.common.base.Function<DATA,DATA> transformation)
Start building a stage chain. |
|
static
|
extractInflector(Object stage)
(Optionally) extracts an inflector from a processing stage,
provided the stage implements Inflecting interface. |
|
static
|
identity()
Get a chainable "identity" stage. |
|
static
|
process(DATA data,
Stage<DATA> rootStage)
Run the data through a chain of stages identified by the root stage. |
|
static
|
process(DATA data,
Stage<DATA> rootStage,
Ref<T> inflectorRef)
Run the data through a chain of stages identified by the root stage. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <DATA> ChainableStage<DATA> identity()
DATA - data type transformable by the stage.
public static <DATA,RESULT> Stage<DATA> asStage(Inflector<DATA,RESULT> inflector)
Stages.LinkedStage that implements Inflecting
interface and returns the provided Inflector instance
when the Inflecting.inflector() method is called.
DATA - data type transformable by the stage and returned inflector.RESULT - type of result produced by a successful inflector data transformation.inflector - a request to response transformation to be wrapped in
a stage.
Inflector.public static <DATA,RESULT,T extends Inflector<DATA,RESULT>> T extractInflector(Object stage)
inflector from a processing stage,
provided the stage implements Inflecting interface. Otherwise method
returns null.
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.
null otherwise.public static <DATA> Stage.Builder<DATA> chain(com.google.common.base.Function<DATA,DATA> transformation)
transformation - root transformation function.
public static <DATA> Stage.Builder<DATA> chain(ChainableStage<DATA> rootStage)
rootStage - root chainable linear stage.
public static <DATA> DATA process(DATA data,
Stage<DATA> rootStage)
DATA - processed data type.data - data to be processed.rootStage - root stage of the stage chain.
public static <DATA,RESULT,T extends Inflector<DATA,RESULT>> DATA process(DATA data,
Stage<DATA> rootStage,
Ref<T> inflectorRef)
inflectorRef
parameter.
DATA - processed data type.data - data to be processed.rootStage - root stage of the stage chain.inflectorRef - a mutable reference to an inflector.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||