public class ApplicationFormFactory extends Object implements MediaTypeFactory
MediaTypeFactory
for Media-Type
"application/x-www-form-urlencoded" (
MediaType.APPLICATION_X_WWW_FORM_URLENCODED
).
CAUTION: This implementation can only marshal objects of (sub-)type
Map
of generic type String
(key) and List
containing
String
instances (value) as argument. Also supported is the derived
FormFields
type.MediaTypeAccessor.MediaTypeBuilder<B extends MediaTypeAccessor.MediaTypeBuilder<B>>, MediaTypeAccessor.MediaTypeMutator, MediaTypeAccessor.MediaTypeProperty
Constructor and Description |
---|
ApplicationFormFactory() |
Modifier and Type | Method and Description |
---|---|
MediaType |
getMediaType()
Retrieves the Media-Type from the Media-Type property.
|
String |
toMarshaled(Object aObject)
|
<T> T |
toUnmarshaled(String aHttpBody,
Class<T> aType)
This method creates / retrieves an instance of the given type from the
provided instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromMarshaled, fromMarshaled, fromMarshaled, fromMarshaled, fromUnmarshaled, fromUnmarshaled
toUnmarshaled, toUnmarshaled, toUnmarshaled
toMarshaled
public MediaType getMediaType()
getMediaType
in interface MediaTypeAccessor
public String toMarshaled(Object aObject) throws org.refcodes.exception.MarshalException
Map
of generic type
String
(key) and List
containing String
instances
(value) as argument. Also supported is the derived FormFields
type.
This method creates / retrieves an instance of the given type with the
given identifier (name) constructed as defined in one to many
configuration files. How the instance is configured, created or retrieved
is up to the nature (implementation) of the according factory.toMarshaled
in interface Marshalable<String>
aObject
- The context which may influence the object being created
by this factory.org.refcodes.exception.MarshalException
- Thrown when marshaling / serializing an object
fails.public <T> T toUnmarshaled(String aHttpBody, Class<T> aType) throws org.refcodes.exception.UnmarshalException
Unmarshalable
toUnmarshaled
in interface Unmarshalable<String>
T
- The type which is to be fabricated by the factory method.aHttpBody
- The context which may influence the object being created
by this factory.aType
- The type identifying the instance to be created / retrieved.org.refcodes.exception.UnmarshalException
- Thrown when unmarshaling / deserializing an
object fails.Copyright © 2018. All rights reserved.