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.
 
| Modifier and Type | Field and Description | 
|---|---|
static String | 
XP_MARSHALLERS  | 
lastModified, name| Constructor and Description | 
|---|
MarshallerRegistryImpl()  | 
| Modifier and Type | Method and Description | 
|---|---|
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. 
 | 
protected boolean | 
register(String xp,
        Descriptor descriptor)  | 
protected boolean | 
unregister(String xp,
          Descriptor descriptor)  | 
activate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregisterContribution, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStarted, getApplicationStartedOrderpublic static final String XP_MARSHALLERS
public MarshallerRegistryImpl()
public 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 contextprotected boolean register(String xp, Descriptor descriptor)
register in class DefaultComponentprotected boolean unregister(String xp, Descriptor descriptor)
unregister in class DefaultComponentpublic void register(Class<?> marshaller)
MarshallerRegistryregister in interface MarshallerRegistrymarshaller - The marshaller class.public void deregister(Class<?> marshaller)
MarshallerRegistryderegister in interface MarshallerRegistrymarshaller - The marshaller class.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 © 2019 Nuxeo. All rights reserved.