public class MarshallerInspector extends Object implements Comparable<MarshallerInspector>
Setup
and
inspect every attributes having Inject
annotation.
To get a valid marshaller instance :
MarshallerInspector(Class)
. This will
checks your marshaller has annotation Setup
and inspect every attributes having Inject
annotation.Writer
by calling isWriter()
Reader
by calling isReader()
getInstance(RenderingContext)
to get a valid marshaller instance with
RenderingContext
and required services injected.
This class implements Comparable
and then handle marshaller priorities rules: look at
MarshallerRegistry
javadoc to read the rules.
Constructor and Description |
---|
MarshallerInspector(Class<?> clazz)
Create an inspector for the given class.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MarshallerInspector inspector) |
boolean |
equals(Object obj)
Two
MarshallerInspector are equals if their managed clazz are the same. |
Type |
getGenericType() |
<T> T |
getInstance(RenderingContext ctx)
Create an instance of this marshaller.
|
Instantiations |
getInstantiations() |
Class<?> |
getMarshalledType() |
Object |
getNewInstance(RenderingContext ctx,
boolean threadSafe)
Create a new instance of the marshaller.
|
Integer |
getPriority() |
List<javax.ws.rs.core.MediaType> |
getSupports() |
boolean |
isMarshaller() |
boolean |
isReader() |
boolean |
isWriter() |
public MarshallerInspector(Class<?> clazz)
clazz
- The class to analyse and instantiate.public <T> T getInstance(RenderingContext ctx)
ctx
- The RenderingContext
to inject, if null create an empty context.public Object getNewInstance(RenderingContext ctx, boolean threadSafe)
ctx
- The RenderingContext
to inject.public Instantiations getInstantiations()
public Integer getPriority()
public List<javax.ws.rs.core.MediaType> getSupports()
public Class<?> getMarshalledType()
public Type getGenericType()
public boolean isMarshaller()
public boolean isWriter()
public boolean isReader()
public int compareTo(MarshallerInspector inspector)
compareTo
in interface Comparable<MarshallerInspector>
public boolean equals(Object obj)
MarshallerInspector
are equals if their managed clazz are the same.Copyright © 2015 Nuxeo SA. All rights reserved.