Package org.apache.juneau.httppart
Class BaseHttpPartParser
java.lang.Object
org.apache.juneau.Context
org.apache.juneau.BeanContextable
org.apache.juneau.httppart.BaseHttpPartParser
- All Implemented Interfaces:
AnnotationProvider
,HttpPartParser
- Direct Known Subclasses:
SimplePartParser
Base class for implementations of
HttpPartParser
Notes:
- This class is thread safe and reusable.
See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.juneau.httppart.HttpPartParser
HttpPartParser.Creator, HttpPartParser.Void
-
Field Summary
Fields inherited from class org.apache.juneau.Context
CONTEXT_APPLY_FILTER
Fields inherited from interface org.apache.juneau.AnnotationProvider
DEFAULT, DISABLE_ANNOTATION_CACHING
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor. -
Method Summary
Modifier and TypeMethodDescription<T> ClassMeta<T>
getClassMeta
(Class<T> c) Returns metadata about the specified class.<T> ClassMeta<T>
getClassMeta
(Type t, Type... args) Returns metadata about the specified class.<T> T
parse
(HttpPartType partType, HttpPartSchema schema, String in, Class<T> toType) Converts the specified input to the specified class type.<T> T
parse
(HttpPartType partType, HttpPartSchema schema, String in, Type toType, Type... toTypeArgs) Converts the specified input to the specified class type.<T> T
parse
(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> toType) Converts the specified input to the specified class type.Methods inherited from class org.apache.juneau.BeanContextable
getBeanContext, properties
Methods inherited from class org.apache.juneau.Context
copy, createBuilder, createSession, firstAnnotation, firstAnnotation, firstAnnotation, firstAnnotation, firstDeclaredAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachDeclaredAnnotation, getSession, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, init, isDebug, lastAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastDeclaredAnnotation, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.juneau.httppart.HttpPartParser
getPartSession
-
Constructor Details
-
BaseHttpPartParser
Constructor.- Parameters:
builder
- The builder for this object.
-
-
Method Details
-
parse
public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> toType) throws ParseException, SchemaValidationException Converts the specified input to the specified class type.- Type Parameters:
T
- The POJO type to transform the input into.- Parameters:
partType
- The part type being parsed.schema
- Schema information about the part.
May benull .
Not all part parsers use the schema information.in
- The input being parsed.toType
- The POJO type to transform the input into.- Returns:
- The parsed value.
- Throws:
ParseException
- Malformed input encountered.SchemaValidationException
- If the input or resulting HTTP part object fails schema validation.
-
parse
public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, Class<T> toType) throws ParseException, SchemaValidationException Converts the specified input to the specified class type.- Type Parameters:
T
- The POJO type to transform the input into.- Parameters:
partType
- The part type being parsed.schema
- Schema information about the part.
May benull .
Not all part parsers use the schema information.in
- The input being parsed.toType
- The POJO type to transform the input into.- Returns:
- The parsed value.
- Throws:
ParseException
- Malformed input encountered.SchemaValidationException
- If the input or resulting HTTP part object fails schema validation.
-
parse
public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, Type toType, Type... toTypeArgs) throws ParseException, SchemaValidationException Converts the specified input to the specified class type.- Type Parameters:
T
- The POJO type to transform the input into.- Parameters:
partType
- The part type being parsed.schema
- Schema information about the part.
May benull .
Not all part parsers use the schema information.in
- The input being parsed.toType
- The POJO type to transform the input into.toTypeArgs
- The generic type arguments of the POJO type to transform the input into.- Returns:
- The parsed value.
- Throws:
ParseException
- Malformed input encountered.SchemaValidationException
- If the input or resulting HTTP part object fails schema validation.
-
getClassMeta
Description copied from interface:HttpPartParser
Returns metadata about the specified class.- Specified by:
getClassMeta
in interfaceHttpPartParser
- Type Parameters:
T
- The class type.- Parameters:
c
- The class type.- Returns:
- Metadata about the specified class.
-
getClassMeta
Description copied from interface:HttpPartParser
Returns metadata about the specified class.- Specified by:
getClassMeta
in interfaceHttpPartParser
- Type Parameters:
T
- The class type.- Parameters:
t
- The class type.args
- The class type args.- Returns:
- Metadata about the specified class.
-