Package org.refcodes.net
Class ApplicationXmlFactory
- java.lang.Object
-
- org.refcodes.net.ApplicationJsonFactory
-
- org.refcodes.net.ApplicationXmlFactory
-
- All Implemented Interfaces:
Marshalable<java.lang.String>
,MediaTypeAccessor
,MediaTypeFactory
,Unmarshalable<java.lang.String>
- Direct Known Subclasses:
TextXmlFactory
public class ApplicationXmlFactory extends ApplicationJsonFactory implements MediaTypeFactory
Implements theMediaTypeFactory
for Media-Type "application/xml" (MediaType.APPLICATION_XML
). CAUTION: This implementation uses getter/setter property resolution instead of field resolution as of the used marshaling API.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.MediaTypeAccessor
MediaTypeAccessor.MediaTypeBuilder<B extends MediaTypeAccessor.MediaTypeBuilder<B>>, MediaTypeAccessor.MediaTypeMutator, MediaTypeAccessor.MediaTypeProperty
-
-
Constructor Summary
Constructors Constructor Description ApplicationXmlFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaType
getMediaType()
Retrieves the Media-Type from the Media-Type property.java.lang.String
toMarshaled(java.lang.Object aObject)
This method creates / retrieves an instance of the given type with the given identifier (name) constructed as defined in one to many configuration files.<T> T
toUnmarshaled(java.lang.String aHttpBody, java.lang.Class<T> aType)
This method creates / retrieves an instance of the given type from the provided instance.-
Methods inherited from class org.refcodes.net.ApplicationJsonFactory
toElementName, toPlainJson, toUnboxed, toVariableDeclaration
-
Methods inherited from interface org.refcodes.net.Marshalable
toMarshaled
-
Methods inherited from interface org.refcodes.net.MediaTypeFactory
fromMarshaled, fromMarshaled, fromMarshaled, fromMarshaled, fromUnmarshaled, fromUnmarshaled
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.net.Unmarshalable
toUnmarshaled, toUnmarshaled, toUnmarshaled
-
-
-
-
Method Detail
-
getMediaType
public MediaType getMediaType()
Retrieves the Media-Type from the Media-Type property.- Specified by:
getMediaType
in interfaceMediaTypeAccessor
- Overrides:
getMediaType
in classApplicationJsonFactory
- Returns:
- The Media-Type stored by the Media-Type property.
-
toMarshaled
public java.lang.String toMarshaled(java.lang.Object aObject) throws org.refcodes.exception.MarshalException
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.- Specified by:
toMarshaled
in interfaceMarshalable<java.lang.String>
- Overrides:
toMarshaled
in classApplicationJsonFactory
- Parameters:
aObject
- The context which may influence the object being created by this factory.- Returns:
- The instance being fabricated by this factory.
- Throws:
org.refcodes.exception.MarshalException
- Thrown when marshaling / serializing an object fails.
-
toUnmarshaled
public <T> T toUnmarshaled(java.lang.String aHttpBody, java.lang.Class<T> aType) throws org.refcodes.exception.UnmarshalException
This method creates / retrieves an instance of the given type from the provided instance.- Specified by:
toUnmarshaled
in interfaceUnmarshalable<java.lang.String>
- Overrides:
toUnmarshaled
in classApplicationJsonFactory
- Type Parameters:
T
- The type which is to be fabricated by the factory method.- Parameters:
aHttpBody
- The context which may influence the object being created by this factory.aType
- The type identifying the instance to be created / retrieved.- Returns:
- An instance of the required type for the given type and context.
- Throws:
org.refcodes.exception.UnmarshalException
- Thrown when unmarshaling / deserializing an object fails.
-
-