Package org.apache.juneau.http.header
Class HeaderBeanMeta<T>
java.lang.Object
org.apache.juneau.http.header.HeaderBeanMeta<T>
- Type Parameters:
T
- The header bean type.
Holds metadata about header beans (POJOs that get serialized as HTTP headers).
Header beans are typically annotated with @Header
although it's not an
absolute requirement.
Header beans must have one of the following public constructors:
public X(StringheaderValue )public X(ObjectheaderValue )public X(StringheaderName , StringheaderValue )public X(StringheaderName , ObjectheaderValue )
Example
See Also:
-
Method Summary
Modifier and TypeMethodDescriptionConstructs a header bean with the specified name or value.Constructs a header bean with the specified name or value.Returns schema information about this header.static <T> HeaderBeanMeta<T>
Finds the header bean meta for the specified type.
-
Method Details
-
of
Finds the header bean meta for the specified type.- Type Parameters:
T
- The header bean type.- Parameters:
type
- The header bean type.- Returns:
- The metadata, or
null if a valid constructor could not be found.
-
getSchema
Returns schema information about this header.This is information pulled from
@Header
annotation on the class.- Returns:
- The schema information.
-
construct
Constructs a header bean with the specified name or value.Can only be used on beans where the header name is known.
- Parameters:
value
- The header value.- Returns:
- A newly constructed bean.
-
construct
Constructs a header bean with the specified name or value.- Parameters:
name
- The header name.
Ifnull , uses the value pulled from the@Header(name)
or@Header(value)
annotations.value
- The header value.- Returns:
- A newly constructed bean.
- Throws:
UnsupportedOperationException
- If bean could not be constructed (e.g. couldn't find a constructor).
-