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 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:
  • MyObjectGraphTransformer
  • javax.inject.Provider&lt;ObjectGraphTransformer&lt;MyFilteringObject&gt;&gt;

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&lt;ObjectGraphTransformer&lt;Object&gt;&gt;
  • javax.inject.Provider&lt;ObjectGraphTransformer&lt;ObjectGraph&gt;&gt;

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Transform a given graph into an entity-filtering object.
  • Method Details

    • 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.