Interface ObjectGraphTransformer<T>
-
- Type Parameters:
T
- representation of entity data filtering requested by provider.
- All Known Implementing Classes:
AbstractObjectProvider
,JacksonObjectProvider
,ObjectGraphProvider
@Contract public interface ObjectGraphTransformer<T>
This contract brings support for transforming an internal representation of entity data filtering feature into an object familiar to underlying provider (e.g. message body worker).This interface is supposed to be implemented by modules providing JAX-RS/Jersey providers / configuration object (e.g. message body workers) that can directly affect reading/writing of an entity.
Implementations should be registered into client/server runtime via
jersey binder
(for more information and common implementation seeAbstractObjectProvider
):bindAsContract(MyObjectGraphTransformer.class) // FilteringGraphTransformer. .to(new TypeLiteral<ObjectGraphTransformer<MyFilteringObject>>() {}) // Scope. .in(Singleton.class);
The custom transformer can be theninjected
as one these injection point types:MyObjectGraphTransformer
javax.inject.Provider<ObjectGraphTransformer<MyFilteringObject>>
By default a
ObjectGraph
->ObjectGraph
transformer is available in the runtime. This transformer can be injected (via@Inject
) into the following types:ObjectGraphTransformer
javax.inject.Provider<ObjectGraphTransformer<Object>>
javax.inject.Provider<ObjectGraphTransformer<ObjectGraph>>
- See Also:
AbstractObjectProvider
,ObjectProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
transform(ObjectGraph graph)
Transform a given graph into an entity-filtering object.
-
-
-
Method Detail
-
transform
T transform(ObjectGraph graph)
Transform a given graph into an entity-filtering object. The entire graph (incl. it's subgraphs) should be processed by this method as this method is invoked only once for a root entity class.- Parameters:
graph
- object graph to be transformed.- Returns:
- entity-filtering object requested by provider.
-
-