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:
String
parameter.
String
parameter:
fromString
fromValue
valueOf
parse
parseString
forName
forString
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.
|
<T> T |
parse(HttpPartType partType,
String in,
ClassMeta<T> type)
Deprecated.
Unused.
|
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
- If a problem occurred while trying to parse the input.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
- If a problem occurred while trying to parse the input.SchemaValidationException
- If the input fails schema validation.@Deprecated public <T> T parse(HttpPartType partType, String in, ClassMeta<T> type) throws ParseException
ParseException
Copyright © 2018 Apache. All rights reserved.