Package org.refcodes.net
Class FormMediaTypeFactory
- java.lang.Object
-
- org.refcodes.net.FormMediaTypeFactory
-
- All Implemented Interfaces:
org.refcodes.factory.MarshalFactory<String>
,org.refcodes.factory.MarshalFactory.MarshalFactoryComplement<String>
,org.refcodes.factory.MarshalFactory.MarshalFactoryComposite<String,InputStream>
,org.refcodes.factory.UnmarshalFactory<String>
,org.refcodes.factory.UnmarshalFactory.UnmarshalFactoryComplement<String>
,org.refcodes.factory.UnmarshalFactory.UnmarshalFactoryComposite<String,InputStream>
,MediaTypeFactory
,MediaTypesAccessor
public class FormMediaTypeFactory extends Object implements MediaTypeFactory
Implements theMediaTypeFactory
for Media-Type "application/x-www-form-urlencoded" (MediaType.APPLICATION_X_WWW_FORM_URLENCODED
). CAUTION: This implementation can only marshal objects of (sub-)typeMap
of generic typeString
(key) andList
containingString
instances (value) as argument. Also supported is the derivedFormFields
type.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.factory.MarshalFactory
org.refcodes.factory.MarshalFactory.MarshalFactoryComplement<C extends Object>, org.refcodes.factory.MarshalFactory.MarshalFactoryComposite<T extends Object,C extends Object>
-
Nested classes/interfaces inherited from interface org.refcodes.net.MediaTypesAccessor
MediaTypesAccessor.MediaTypesBuilder<B extends MediaTypesAccessor.MediaTypesBuilder<B>>, MediaTypesAccessor.MediaTypesMutator, MediaTypesAccessor.MediaTypesProperty
-
-
Field Summary
-
Fields inherited from interface org.refcodes.net.MediaTypeFactory
ARRAY_SELECTOR, COLLECTION_SELECTOR, TYPE_ANNOTATION, VALUE_SELECTOR
-
-
Constructor Summary
Constructors Constructor Description FormMediaTypeFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaType[]
getMediaTypes()
Retrieves the Media-Types from the Media-Types property.String
toMarshaled(Object aObject)
<T> T
toUnmarshaled(String aHttpBody, Class<T> aType)
-
Methods inherited from interface org.refcodes.net.MediaTypeFactory
fromMarshaled, fromMarshaled, fromMarshaled, fromMarshaled, fromUnmarshaled, fromUnmarshaled
-
-
-
-
Method Detail
-
getMediaTypes
public MediaType[] getMediaTypes()
Retrieves the Media-Types from the Media-Types property.- Specified by:
getMediaTypes
in interfaceMediaTypesAccessor
- Returns:
- The Media-Types stored by the Media-Types property.
-
toMarshaled
public String toMarshaled(Object aObject) throws org.refcodes.exception.MarshalException
This method expects an instance of (sub-)typeMap
of generic typeString
(key) andList
containingString
instances (value) as argument. Also supported is the derivedFormFields
type.- Specified by:
toMarshaled
in interfaceorg.refcodes.factory.MarshalFactory<String>
- Throws:
org.refcodes.exception.MarshalException
-
-