public class MarshallerRegistryImpl extends DefaultComponent implements MarshallerRegistry
MarshallerRegistry.
This implementation is based on MarshallerInspector class which is able to create marshaller instance and
inject properties. This class also manage marshaller's priorities.
lastModified| Constructor and Description |
|---|
MarshallerRegistryImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ComponentContext context)
Activates the component.
|
void |
clear()
Be careful !!! That's deregister all marshallers.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
void |
deregister(Class<?> marshaller)
Remove a marshaller from the registry.
|
<T> Collection<Marshaller<T>> |
getAllMarshallers(RenderingContext ctx,
Class<T> marshalledClazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype,
Set<MarshallerInspector> customs,
Set<MarshallerInspector> wildcards) |
<T> Collection<Reader<T>> |
getAllReaders(RenderingContext ctx,
Class<T> marshalledClazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype)
Provides all
Reader instance that manage marshalling of a mimetype in a Java Type. |
<T> Collection<Writer<T>> |
getAllWriters(RenderingContext ctx,
Class<T> marshalledClazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype)
Provides all
Writer instance that manage marshalling of the given Java Type and mimetype. |
<T> T |
getInstance(RenderingContext ctx,
Class<T> marshallerClass)
Provides an instance of a given marshaller class.
|
<T> Marshaller<T> |
getMarshaller(RenderingContext ctx,
Class<T> marshalledClazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype,
Set<MarshallerInspector> customs,
Set<MarshallerInspector> wildcards,
boolean forceInstantiation) |
<T> Reader<T> |
getReader(RenderingContext ctx,
Class<T> marshalledClazz,
javax.ws.rs.core.MediaType mediatype)
|
<T> Reader<T> |
getReader(RenderingContext ctx,
Class<T> marshalledClazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype)
Provides a
Reader instance to manage marshalling of a mimetype in a Java Type. |
<T> T |
getUniqueInstance(RenderingContext ctx,
Class<T> marshallerClass)
Provides an instance of the given marshaller class.
|
<T> Reader<T> |
getUniqueReader(RenderingContext ctx,
Class<T> marshalledClazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype)
Provides a
Reader instance to manage marshalling of a mimetype in a Java Type. |
<T> Writer<T> |
getUniqueWriter(RenderingContext ctx,
Class<T> marshalledClazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype)
Provides a
Writer instance to manage marshalling of the given Java Type and mimetype. |
<T> Writer<T> |
getWriter(RenderingContext ctx,
Class<T> marshalledClazz,
javax.ws.rs.core.MediaType mediatype)
|
<T> Writer<T> |
getWriter(RenderingContext ctx,
Class<T> marshalledClazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype)
Provides a
Writer instance to manage marshalling of the given Java Type and mimetype. |
void |
register(Class<?> marshaller)
Makes a marshaller class available.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
applicationStarted, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtensionpublic MarshallerRegistryImpl()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic void deactivate(ComponentContext context)
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution in class DefaultComponentpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution in class DefaultComponentpublic void register(Class<?> marshaller)
MarshallerRegistryregister in interface MarshallerRegistrymarshaller - The marshaller class.public void deregister(Class<?> marshaller) throws MarshallingException
MarshallerRegistryderegister in interface MarshallerRegistrymarshaller - The marshaller class.MarshallingException - If marshaller class is null or if it's not a valid marshaller.public <T> Writer<T> getWriter(RenderingContext ctx, Class<T> marshalledClazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
MarshallerRegistryWriter instance to manage marshalling of the given Java Type and mimetype.getWriter in interface MarshallerRegistryctx - The marshalling context (see RenderingContext).marshalledClazz - The java type to manage.genericType - The generic Java type to manage.mediatype - The expected mimetype.Writer instance.public <T> Writer<T> getUniqueWriter(RenderingContext ctx, Class<T> marshalledClazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
MarshallerRegistryWriter instance to manage marshalling of the given Java Type and mimetype. It creates a new
instance even for Instantiations.SINGLETON marshallers.getUniqueWriter in interface MarshallerRegistryctx - The marshalling context (see RenderingContext).marshalledClazz - The java type to manage.genericType - The generic Java type to manage.mediatype - The expected mimetype.Writer instance.public <T> Collection<Writer<T>> getAllWriters(RenderingContext ctx, Class<T> marshalledClazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
MarshallerRegistryWriter instance that manage marshalling of the given Java Type and mimetype.getAllWriters in interface MarshallerRegistryctx - The marshalling context (see RenderingContext).marshalledClazz - The java type to manage.genericType - The generic Java type to manage.mediatype - The expected mimetype.Writer instance.public <T> Writer<T> getWriter(RenderingContext ctx, Class<T> marshalledClazz, javax.ws.rs.core.MediaType mediatype)
MarshallerRegistrygetWriter in interface MarshallerRegistrypublic <T> Reader<T> getReader(RenderingContext ctx, Class<T> marshalledClazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
MarshallerRegistryReader instance to manage marshalling of a mimetype in a Java Type.getReader in interface MarshallerRegistryctx - The marshalling context (see RenderingContext).marshalledClazz - The java type to manage.genericType - The generic Java type to manage.mediatype - The expected mimetype.Reader instance.public <T> Reader<T> getUniqueReader(RenderingContext ctx, Class<T> marshalledClazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
MarshallerRegistryReader instance to manage marshalling of a mimetype in a Java Type. It creates a new instance
even for Instantiations.SINGLETON marshallers.getUniqueReader in interface MarshallerRegistryctx - The marshalling context (see RenderingContext).marshalledClazz - The java type to manage.genericType - The generic Java type to manage.mediatype - The expected mimetype.Reader instance.public <T> Collection<Reader<T>> getAllReaders(RenderingContext ctx, Class<T> marshalledClazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
MarshallerRegistryReader instance that manage marshalling of a mimetype in a Java Type.getAllReaders in interface MarshallerRegistryctx - The marshalling context (see RenderingContext).marshalledClazz - The java type to manage.genericType - The generic Java type to manage.mediatype - The expected mimetype.Reader instance.public <T> Reader<T> getReader(RenderingContext ctx, Class<T> marshalledClazz, javax.ws.rs.core.MediaType mediatype)
MarshallerRegistrygetReader in interface MarshallerRegistrypublic <T> Marshaller<T> getMarshaller(RenderingContext ctx, Class<T> marshalledClazz, Type genericType, javax.ws.rs.core.MediaType mediatype, Set<MarshallerInspector> customs, Set<MarshallerInspector> wildcards, boolean forceInstantiation)
public <T> Collection<Marshaller<T>> getAllMarshallers(RenderingContext ctx, Class<T> marshalledClazz, Type genericType, javax.ws.rs.core.MediaType mediatype, Set<MarshallerInspector> customs, Set<MarshallerInspector> wildcards)
public <T> T getInstance(RenderingContext ctx, Class<T> marshallerClass)
MarshallerRegistrygetInstance in interface MarshallerRegistryctx - The marshalling context (see RenderingContext).marshallerClass - A valid marshaller instance.public <T> T getUniqueInstance(RenderingContext ctx, Class<T> marshallerClass)
MarshallerRegistryInstantiations.SINGLETON marshallers.getUniqueInstance in interface MarshallerRegistryctx - The marshalling context (see RenderingContext).marshallerClass - A valid marshaller instance.public void clear()
MarshallerRegistryclear in interface MarshallerRegistryCopyright © 2016 Nuxeo SA. All rights reserved.