Class ViewElementLookupRegistryImpl
java.lang.Object
com.foreach.across.modules.entity.views.ViewElementLookupRegistryImpl
- All Implemented Interfaces:
ViewElementLookupRegistry,Cloneable
- Author:
- Arne Vandamme
-
Constructor Summary
Constructors -
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) IfViewElementLookupRegistry.isCacheable(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.booleanbooleanisEmpty()Checks whether any lookup values have been applied to the registry.voidmergeInto(ViewElementLookupRegistry existing) Merge the current values into an already existing 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.voidsetDefaultCacheable(boolean defaultCacheable) 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.
-
Constructor Details
-
ViewElementLookupRegistryImpl
public ViewElementLookupRegistryImpl()
-
-
Method Details
-
isDefaultCacheable
public boolean isDefaultCacheable() -
setDefaultCacheable
public void setDefaultCacheable(boolean defaultCacheable) -
setViewElementBuilder
public void setViewElementBuilder(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementBuilder builder) Description copied from interface:ViewElementLookupRegistrySet the fixedViewElementBuilderfor lookups. If set, this builder will always be returned.- Specified by:
setViewElementBuilderin interfaceViewElementLookupRegistry- Parameters:
mode- to register the builder forbuilder- instance to store
-
addViewElementPostProcessor
public void addViewElementPostProcessor(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementPostProcessor<?> postProcessor) Description copied from interface:ViewElementLookupRegistryAdd aViewElementPostProcessorthat should be applied to the element builder.- Specified by:
addViewElementPostProcessorin interfaceViewElementLookupRegistry- Parameters:
mode- to register the postprocessor forpostProcessor- to add
-
cacheViewElementBuilder
public boolean cacheViewElementBuilder(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementBuilder builder) Description copied from interface:ViewElementLookupRegistryIfViewElementLookupRegistry.isCacheable(ViewElementMode)returnsfalsethis call will have no effect and return value should also befalse.- Specified by:
cacheViewElementBuilderin interfaceViewElementLookupRegistry- Parameters:
mode- to register the builder forbuilder- instance to store- Returns:
- true if the builder was actually stored
-
getViewElementType
- Specified by:
getViewElementTypein interfaceViewElementLookupRegistry- Parameters:
mode- to create the type for- Returns:
- the registered view element type - null if none available
-
setViewElementType
Description copied from interface:ViewElementLookupRegistrySet the view element type for subsequent lookup.- Specified by:
setViewElementTypein interfaceViewElementLookupRegistry- Parameters:
mode- to register the type forviewElementType- to store
-
setCacheable
Description copied from interface:ViewElementLookupRegistrySets the cacheable status for a given mode.- Specified by:
setCacheablein interfaceViewElementLookupRegistry- Parameters:
mode- to set the status forcacheable- true if subsequent calls can be cached
-
reset
Description copied from interface:ViewElementLookupRegistryRemoves the cached builder for the given mode.- Specified by:
resetin interfaceViewElementLookupRegistry- Parameters:
mode- to remove the cached builder for
-
getViewElementBuilder
public com.foreach.across.modules.web.ui.ViewElementBuilder getViewElementBuilder(ViewElementMode mode) - Specified by:
getViewElementBuilderin interfaceViewElementLookupRegistry- Parameters:
mode- to create the builder for- Returns:
- the registered builder - null if none available
-
getCachedViewElementBuilder
public com.foreach.across.modules.web.ui.ViewElementBuilder getCachedViewElementBuilder(ViewElementMode mode) Description copied from interface:ViewElementLookupRegistryRetrieve the (optionally) cached builder. Will return null if either not cached or not cacheable.- Specified by:
getCachedViewElementBuilderin interfaceViewElementLookupRegistry- Parameters:
mode- to get the builder for- Returns:
- the registered builder - null if none available
-
clearCache
public void clearCache()Description copied from interface:ViewElementLookupRegistryRemoves all cached builders.- Specified by:
clearCachein interfaceViewElementLookupRegistry
-
getViewElementPostProcessors
public Collection<com.foreach.across.modules.web.ui.ViewElementPostProcessor<?>> getViewElementPostProcessors(ViewElementMode mode) - Specified by:
getViewElementPostProcessorsin interfaceViewElementLookupRegistry- Parameters:
mode- to get the postprocessors for- Returns:
- collection of postprocessors
-
isCacheable
Description copied from interface:ViewElementLookupRegistryIf 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.- Specified by:
isCacheablein interfaceViewElementLookupRegistry- Parameters:
mode- to check for- Returns:
- true if a builder can be cached
-
isEmpty
public boolean isEmpty()Description copied from interface:ViewElementLookupRegistryChecks whether any lookup values have been applied to the registry.- Specified by:
isEmptyin interfaceViewElementLookupRegistry
-
mergeInto
Merge the current values into an already existing registry. This will clear the entire cache of the target registry.- Parameters:
existing- to merge the values in
-
clone
- Specified by:
clonein interfaceViewElementLookupRegistry- Overrides:
clonein classObject- Returns:
- cloned instance
-