public static interface Parser.Context extends Parser.Builder
type()
and invoke next
parser in the chain via next()
methods.Modifier and Type | Method and Description |
---|---|
Object |
next()
Invoke next parser in the chain.
|
Object |
next(com.google.inject.TypeLiteral<?> type)
Invoke next parser in the chain and switch/change the target type we are looking for.
|
Object |
next(com.google.inject.TypeLiteral<?> type,
Object data)
Invoke next parser in the chain and switch/change the target type we are looking for but also
the current value.
|
<T> T |
require(Class<T> type)
Requires a service with the given type.
|
<T> T |
require(com.google.inject.Key<T> key)
Requires a service with the given type.
|
<T> T |
require(com.google.inject.TypeLiteral<T> type)
Requires a service with the given type.
|
MediaType |
type()
Content Type header, if current context was bind to a HTTP body via
Request.body() . |
<T> T require(Class<T> type)
T
- Service type.type
- Service type.<T> T require(com.google.inject.TypeLiteral<T> type)
T
- Service type.type
- Service type.<T> T require(com.google.inject.Key<T> key)
T
- Service type.key
- Service key.MediaType type()
Request.body()
.
If current context was bind to a HTTP param, media type is set to text/plain
.Object next() throws Exception
Exception
- An err with a 400 status.Object next(com.google.inject.TypeLiteral<?> type) throws Exception
type
- A new type to use.Exception
- An err with a 400 status.Object next(com.google.inject.TypeLiteral<?> type, Object data) throws Exception
type
- A new type to use.data
- Data to be parsed.Exception
- An err with a 400 status.Copyright © 2015. All rights reserved.