Interface ViewElementLookupRegistry
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
ViewElementLookupRegistryImpl
Registry that maps
ViewElementBuilder instances or
element type names fo ViewElementMode. Has a concept of cacheable communicating to the
EntityViewElementBuilderService if a generated ViewElementBuilder
can be cached.
NOTE: This class is mainly for internal use by EntityModule, and subject to breaking changes in future releases.- Author:
- Arne Vandamme
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddViewElementPostProcessor(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementPostProcessor<?> postProcessor) Add aViewElementPostProcessorthat should be applied to the element builder.booleancacheViewElementBuilder(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementBuilder builder) IfisCacheable(ViewElementMode)returnsfalsethis call will have no effect and return value should also befalse.voidRemoves all cached builders.clone()com.foreach.across.modules.web.ui.ViewElementBuilderRetrieve the (optionally) cached builder.com.foreach.across.modules.web.ui.ViewElementBuilderCollection<com.foreach.across.modules.web.ui.ViewElementPostProcessor<?>>booleanisCacheable(ViewElementMode mode) If the result of a certain mode is cacheable, this means that an externalEntityViewElementBuilderServicecan store back the results of a type lookup or builder creation.booleanisEmpty()Checks whether any lookup values have been applied to the registry.voidreset(ViewElementMode mode) Removes the cached builder for the given mode.voidsetCacheable(ViewElementMode mode, boolean cacheable) Sets the cacheable status for a given mode.voidsetViewElementBuilder(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementBuilder builder) Set the fixedViewElementBuilderfor lookups.voidsetViewElementType(ViewElementMode mode, String viewElementType) Set the view element type for subsequent lookup.
-
Method Details
-
setViewElementBuilder
void setViewElementBuilder(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementBuilder builder) Set the fixedViewElementBuilderfor lookups. If set, this builder will always be returned.- Parameters:
mode- to register the builder forbuilder- instance to store
-
addViewElementPostProcessor
void addViewElementPostProcessor(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementPostProcessor<?> postProcessor) Add aViewElementPostProcessorthat should be applied to the element builder.- Parameters:
mode- to register the postprocessor forpostProcessor- to add
-
cacheViewElementBuilder
boolean cacheViewElementBuilder(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementBuilder builder) IfisCacheable(ViewElementMode)returnsfalsethis call will have no effect and return value should also befalse.- Parameters:
mode- to register the builder forbuilder- instance to store- Returns:
- true if the builder was actually stored
-
getCachedViewElementBuilder
com.foreach.across.modules.web.ui.ViewElementBuilder getCachedViewElementBuilder(ViewElementMode mode) Retrieve the (optionally) cached builder. Will return null if either not cached or not cacheable.- Parameters:
mode- to get the builder for- Returns:
- the registered builder - null if none available
-
setViewElementType
Set the view element type for subsequent lookup.- Parameters:
mode- to register the type forviewElementType- to store
-
setCacheable
Sets the cacheable status for a given mode.- Parameters:
mode- to set the status forcacheable- true if subsequent calls can be cached
-
reset
Removes the cached builder for the given mode.- Parameters:
mode- to remove the cached builder for
-
clearCache
void clearCache()Removes all cached builders. -
getViewElementBuilder
- Parameters:
mode- to create the builder for- Returns:
- the registered builder - null if none available
-
getViewElementPostProcessors
Collection<com.foreach.across.modules.web.ui.ViewElementPostProcessor<?>> getViewElementPostProcessors(ViewElementMode mode) - Parameters:
mode- to get the postprocessors for- Returns:
- collection of postprocessors
-
getViewElementType
- Parameters:
mode- to create the type for- Returns:
- the registered view element type - null if none available
-
isCacheable
If the result of a certain mode is cacheable, this means that an externalEntityViewElementBuilderServicecan store back the results of a type lookup or builder creation. Usually aViewElementBuildercan be cached.- Parameters:
mode- to check for- Returns:
- true if a builder can be cached
-
isEmpty
boolean isEmpty()Checks whether any lookup values have been applied to the registry. -
clone
ViewElementLookupRegistry clone()- Returns:
- cloned instance
-