T - representation of entity data filtering requested by provider.@Contract public interface ObjectGraphTransformer<T>
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 see
AbstractObjectProvider):
bindAsContract(MyObjectGraphTransformer.class)
// FilteringGraphTransformer.
.to(new TypeLiteral<ObjectGraphTransformer<MyFilteringObject>>() {})
// Scope.
.in(Singleton.class);
The custom transformer can be then injected as one these injection point types:
MyObjectGraphTransformerjavax.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:
ObjectGraphTransformerjavax.inject.Provider<ObjectGraphTransformer<Object>>javax.inject.Provider<ObjectGraphTransformer<ObjectGraph>>AbstractObjectProvider,
ObjectProvider| Modifier and Type | Method and Description |
|---|---|
T |
transform(ObjectGraph graph)
Transform a given graph into an entity-filtering object.
|
T transform(ObjectGraph graph)
graph - object graph to be transformed.Copyright © 2007-2019, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.