Class PartBeanMeta<T>
java.lang.Object
org.apache.juneau.http.classic.part.PartBeanMeta<T>
- Type Parameters:
T- The HTTP part bean type.
Holds metadata about http part beans (POJOs that get serialized as HTTP parts such as form data or query parameters).
HTTP part beans are typically annotated with @Query, @FormData, or @Path
although it's not an absolute requirement.
HTTP part beans must have one of the following public constructors:
public X(StringpartValue )public X(ObjectpartValue )public X(StringpartName , StringpartValue )public X(StringpartName , ObjectpartValue )
Example
See Also:
-
Method Summary
Modifier and TypeMethodDescriptionConstructs a part bean with the specified name or value.Constructs a part bean with the specified name or value.Returns schema information about this part.static <T> PartBeanMeta<T>Finds the part bean meta for the specified type.
-
Method Details
-
of
Finds the part bean meta for the specified type.- Type Parameters:
T- The part bean type.- Parameters:
type- The part bean type. Must not benull .- Returns:
- The metadata for the specified type. Never
null (a bean with no usable constructor causesconstruct(String,Object)to throw instead).
-
construct
Constructs a part bean with the specified name or value.Can only be used on beans where the part name is known.
- Parameters:
value- The part value.
Can benull . The effect is implementation-dependent, depending on the target bean type's constructor shape — seeconstruct(String, Object).- Returns:
- A newly constructed bean.
- Throws:
UnsupportedOperationException- If bean could not be constructed (e.g. couldn't find a constructor).
-
construct
Constructs a part bean with the specified name or value.- Parameters:
name- The part name.
Ifnull , uses the value pulled from the@Header(name)or@Header(value)annotations.value- The part value.
Can benull . The effect is implementation-dependent, depending on the target bean type's constructor shape (e.g. coerced toString for a single-String -arg constructor, passed through unchanged otherwise).- Returns:
- A newly constructed bean.
- Throws:
UnsupportedOperationException- If bean could not be constructed (e.g. couldn't find a constructor).
-
getSchema
Returns schema information about this part.This is information pulled from
@Query,@FormData, or@Pathannotations on the class.- Returns:
- The schema information.
-