Constructor and Description |
---|
HttpPart(String name,
HttpPartType partType,
HttpPartSchema schema,
HttpPartParser parser,
ParserSessionArgs args,
String part)
Constructor.
|
HttpPart(String name,
HttpPartType partType,
HttpPartSchema schema,
HttpPartSerializer serializer,
SerializerSessionArgs args,
Object part)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
asString()
Returns the value of the part converted to a string.
|
<T> T |
asType(Class<T> c)
Returns the value of the part converted to a string.
|
String |
getName()
Returns the name of the part.
|
public HttpPart(String name, HttpPartType partType, HttpPartSchema schema, HttpPartSerializer serializer, SerializerSessionArgs args, Object part)
Used when the part is in POJO form and needs to be converted to a String.
name
- The HTTP part name (e.g. the header name).partType
- The HTTP part type.schema
- Schema information about the part.serializer
- The part serializer to use to serialize the part.args
- Session arguments to pass to the serializer.part
- The part POJO being serialized.public HttpPart(String name, HttpPartType partType, HttpPartSchema schema, HttpPartParser parser, ParserSessionArgs args, String part)
Used when the part is in String form and needs to be converted to a POJO.
name
- The HTTP part name (e.g. the header name).partType
- The HTTP part type.schema
- Schema information about the part.parser
- The part parser to use to parse the part.args
- Session arguments to pass to the parser.part
- The part string being parsed.public String asString() throws SchemaValidationException, SerializeException
SchemaValidationException
- HTTP part failed schema validation.SerializeException
- HTTP part could not be serialized.public <T> T asType(Class<T> c) throws SchemaValidationException, ParseException
c
- The type to convert to.SchemaValidationException
- HTTP part failed schema validation.ParseException
- Malformed input encountered.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.