Package: org.grails.web.util

## [Groovy] Class ClassAndMimeTypeRegistry<R extends MimeTypeProvider, K>

- org.grails.web.util.ClassAndMimeTypeRegistry

-     @groovy.transform.CompileStatic
      abstract class ClassAndMimeTypeRegistry<R extends MimeTypeProvider, K>
      extends java.lang.Object

  Abstract class for class that maintains a registry of mappings MimeType,Class and a particular object type. Used by RendererRegistry and DataBindingSourceRegistry

  Authors:
    Graeme Rocher
  Since:
    2.3

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `class` | `ClassAndMimeTypeRegistry.1` |

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static MimeTypeProvider` | `NULL_RESOLVE` |
    `private java.util.Map<MimeType, R>` | `defaultObjectsByMimeType` |
    `private java.util.Map<java.lang.Class, java.util.Collection<R>>` | `registeredObjectsByType` |
    `private com.github.benmanes.caffeine.cache.Cache<K, R>` | `resolvedObjectCache` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ClassAndMimeTypeRegistry ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `addToRegisteredObjects(java.lang.Class targetType, R object)`
    `` | `abstract K` | `createCacheKey(java.lang.Class type, MimeType mimeType)`
    `` | `R` | `findMatchingObjectForMimeType(MimeType mimeType, java.lang.Object object)`
    `` | `protected R` | `findRegisteredObjectForType(java.lang.Class currentClass, MimeType mimeType)`
    `` | `java.util.Collection<R>` | `getRegisteredObjects(java.lang.Class targetType)`
    `` | `void` | `registerDefault(MimeType mt, R object)`
    `` | `void` | `removeFromCache(java.lang.Class type, MimeType mimeType)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### private static final MimeTypeProvider NULL_RESOLVE

    - #### private java.util.Map<MimeType, R> defaultObjectsByMimeType

    - #### private java.util.Map<java.lang.Class, java.util.Collection<R>> registeredObjectsByType

    - #### private com.github.benmanes.caffeine.cache.Cache<K, R> resolvedObjectCache

  - ### Constructor Detail

    - #### ClassAndMimeTypeRegistry()

  - ### Method Detail

    - #### void addToRegisteredObjects(java.lang.Class targetType, R object)

    - #### abstract K createCacheKey(java.lang.Class type, MimeType mimeType)

    - #### R findMatchingObjectForMimeType(MimeType mimeType, java.lang.Object object)

    - #### protected R findRegisteredObjectForType(java.lang.Class currentClass, MimeType mimeType)

    - #### java.util.Collection<R> getRegisteredObjects(java.lang.Class targetType)

    - #### void registerDefault(MimeType mt, R object)

    - #### void removeFromCache(java.lang.Class type, MimeType mimeType)