public class SimplePartParser extends BaseHttpPartParser
HttpPartParser
that takes in the strings and tries to convert them to POJOs using constructors and static create methods.
The class being created must be one of the following in order to convert it from a string:
HttpPartParser.Null
Modifier and Type | Field and Description |
---|---|
static SimplePartParser |
DEFAULT
Reusable instance of
SimplePartParser , all default settings. |
Constructor and Description |
---|
SimplePartParser() |
Modifier and Type | Method and Description |
---|---|
SimplePartParserSession |
createPartSession(ParserSessionArgs args)
Creates a new parser session.
|
<T> T |
parse(HttpPartType partType,
HttpPartSchema schema,
String in,
Class<T> toType)
Convenience method for creating a no-arg session and parsing a part.
|
<T> T |
parse(HttpPartType partType,
HttpPartSchema schema,
String in,
Type toType,
Type... toTypeArgs)
Convenience method for creating a no-arg session and parsing a part.
|
createPartSession, parse, parse
public static final SimplePartParser DEFAULT
SimplePartParser
, all default settings.public SimplePartParser()
public SimplePartParserSession createPartSession(ParserSessionArgs args)
HttpPartParser
args
- The runtime arguments for the session.public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, Class<T> toType) throws ParseException, SchemaValidationException
HttpPartParser
partType
- The category of value being parsed.schema
- Schema information about the part.
in
- The value being parsed.toType
- The POJO type to transform the input into.ParseException
- Malformed input encountered.SchemaValidationException
- If the input fails schema validation.public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, Type toType, Type... toTypeArgs) throws ParseException, SchemaValidationException
HttpPartParser
partType
- The category of value being parsed.schema
- Schema information about the part.
in
- The value being parsed.toType
- The POJO type to transform the input into.toTypeArgs
- The POJO type arguments for Collections and Maps.ParseException
- Malformed input encountered.SchemaValidationException
- If the input fails schema validation.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.