Class AbstractObjectProvider<T>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  AbstractObjectProvider.EntityContext
      Class to be used as a key in cache (EntityContext -> filtering object) when processing similar requests.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private T createFilteringObject​(java.lang.Class<?> entityClass, java.util.Set<java.lang.String> filteringScopes, boolean forWriter)
      Create entity-filtering object after this object has not been found in the cache.
      private java.lang.annotation.Annotation[] getEntityAnnotations​(java.lang.annotation.Annotation[] annotations)
      Get entity annotations passed to request/response.
      private T getFilteringObject​(java.lang.Class<?> entityClass, boolean forWriter, java.lang.annotation.Annotation... annotations)  
      T getFilteringObject​(java.lang.reflect.Type genericType, boolean forWriter, java.lang.annotation.Annotation... annotations)
      Get reader/writer entity-filtering object for given type.
      protected java.util.Set<java.lang.String> immutableSetOf​(java.util.Set<java.lang.String> set, java.lang.String item)
      A helper method for a creation of an immutable set based on a provided set together with a given item.
      protected java.lang.String subgraphIdentifier​(java.lang.Class<?> parent, java.lang.String field, java.lang.Class<?> fieldClass)
      Creates a string identifier of a sub-graph.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractObjectProvider

        public AbstractObjectProvider()
    • Method Detail

      • getFilteringObject

        public final T getFilteringObject​(java.lang.reflect.Type genericType,
                                          boolean forWriter,
                                          java.lang.annotation.Annotation... annotations)
        Description copied from interface: ObjectProvider
        Get reader/writer entity-filtering object for given type.
        Specified by:
        getFilteringObject in interface ObjectProvider<T>
        Parameters:
        genericType - type for which the object is requested.
        forWriter - flag to determine whether to create object for reading/writing purposes.
        annotations - entity annotations to determine the runtime scope.
        Returns:
        entity-filtering object.
      • getFilteringObject

        private T getFilteringObject​(java.lang.Class<?> entityClass,
                                     boolean forWriter,
                                     java.lang.annotation.Annotation... annotations)
      • getEntityAnnotations

        private java.lang.annotation.Annotation[] getEntityAnnotations​(java.lang.annotation.Annotation[] annotations)
        Get entity annotations passed to request/response. This method filters annotations that are proxy instances (proxy annotations are taken from resource method and passed in this list).
        Parameters:
        annotations - annotations obtained from provider.
        Returns:
        annoations passed to request/response.
      • createFilteringObject

        private T createFilteringObject​(java.lang.Class<?> entityClass,
                                        java.util.Set<java.lang.String> filteringScopes,
                                        boolean forWriter)
        Create entity-filtering object after this object has not been found in the cache.
        Parameters:
        entityClass - entity class the entity-filtering object should be created for.
        filteringScopes - entity-filtering scopes to create the entity-filtering object for.
        forWriter - flag determining whether the class should be examined for reader or writer.
        Returns:
        entity-filtering object.
      • immutableSetOf

        protected java.util.Set<java.lang.String> immutableSetOf​(java.util.Set<java.lang.String> set,
                                                                 java.lang.String item)
        A helper method for a creation of an immutable set based on a provided set together with a given item.
        Parameters:
        set - The set to create the immutable set from.
        item - The item to add to the set before it's made immutable.
        Returns:
        The immutable set from given set and item.
      • subgraphIdentifier

        protected java.lang.String subgraphIdentifier​(java.lang.Class<?> parent,
                                                      java.lang.String field,
                                                      java.lang.Class<?> fieldClass)
        Creates a string identifier of a sub-graph.
        Parameters:
        parent - The parent class.
        field - The field name.
        fieldClass - The class of the field.
        Returns:
        The string identifier of the sub-graph.