Class ViewElementLookupRegistryImpl
java.lang.Object
com.foreach.across.modules.entity.views.ViewElementLookupRegistryImpl
- All Implemented Interfaces:
ViewElementLookupRegistry
,Cloneable
- Author:
- Arne Vandamme
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addViewElementPostProcessor
(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementPostProcessor<?> postProcessor) Add aViewElementPostProcessor
that should be applied to the element builder.boolean
cacheViewElementBuilder
(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementBuilder builder) IfViewElementLookupRegistry.isCacheable(ViewElementMode)
returnsfalse
this call will have no effect and return value should also befalse
.void
Removes all cached builders.clone()
com.foreach.across.modules.web.ui.ViewElementBuilder
Retrieve the (optionally) cached builder.com.foreach.across.modules.web.ui.ViewElementBuilder
Collection<com.foreach.across.modules.web.ui.ViewElementPostProcessor<?>>
boolean
isCacheable
(ViewElementMode mode) If the result of a certain mode is cacheable, this means that an externalEntityViewElementBuilderService
can store back the results of a type lookup or builder creation.boolean
boolean
isEmpty()
Checks whether any lookup values have been applied to the registry.void
mergeInto
(ViewElementLookupRegistry existing) Merge the current values into an already existing registry.void
reset
(ViewElementMode mode) Removes the cached builder for the given mode.void
setCacheable
(ViewElementMode mode, boolean cacheable) Sets the cacheable status for a given mode.void
setDefaultCacheable
(boolean defaultCacheable) void
setViewElementBuilder
(ViewElementMode mode, com.foreach.across.modules.web.ui.ViewElementBuilder builder) Set the fixedViewElementBuilder
for lookups.void
setViewElementType
(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:ViewElementLookupRegistry
Set the fixedViewElementBuilder
for lookups. If set, this builder will always be returned.- Specified by:
setViewElementBuilder
in 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:ViewElementLookupRegistry
Add aViewElementPostProcessor
that should be applied to the element builder.- Specified by:
addViewElementPostProcessor
in 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:ViewElementLookupRegistry
IfViewElementLookupRegistry.isCacheable(ViewElementMode)
returnsfalse
this call will have no effect and return value should also befalse
.- Specified by:
cacheViewElementBuilder
in interfaceViewElementLookupRegistry
- Parameters:
mode
- to register the builder forbuilder
- instance to store- Returns:
- true if the builder was actually stored
-
getViewElementType
- Specified by:
getViewElementType
in interfaceViewElementLookupRegistry
- Parameters:
mode
- to create the type for- Returns:
- the registered view element type - null if none available
-
setViewElementType
Description copied from interface:ViewElementLookupRegistry
Set the view element type for subsequent lookup.- Specified by:
setViewElementType
in interfaceViewElementLookupRegistry
- Parameters:
mode
- to register the type forviewElementType
- to store
-
setCacheable
Description copied from interface:ViewElementLookupRegistry
Sets the cacheable status for a given mode.- Specified by:
setCacheable
in interfaceViewElementLookupRegistry
- Parameters:
mode
- to set the status forcacheable
- true if subsequent calls can be cached
-
reset
Description copied from interface:ViewElementLookupRegistry
Removes the cached builder for the given mode.- Specified by:
reset
in interfaceViewElementLookupRegistry
- Parameters:
mode
- to remove the cached builder for
-
getViewElementBuilder
public com.foreach.across.modules.web.ui.ViewElementBuilder getViewElementBuilder(ViewElementMode mode) - Specified by:
getViewElementBuilder
in 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:ViewElementLookupRegistry
Retrieve the (optionally) cached builder. Will return null if either not cached or not cacheable.- Specified by:
getCachedViewElementBuilder
in interfaceViewElementLookupRegistry
- Parameters:
mode
- to get the builder for- Returns:
- the registered builder - null if none available
-
clearCache
public void clearCache()Description copied from interface:ViewElementLookupRegistry
Removes all cached builders.- Specified by:
clearCache
in interfaceViewElementLookupRegistry
-
getViewElementPostProcessors
public Collection<com.foreach.across.modules.web.ui.ViewElementPostProcessor<?>> getViewElementPostProcessors(ViewElementMode mode) - Specified by:
getViewElementPostProcessors
in interfaceViewElementLookupRegistry
- Parameters:
mode
- to get the postprocessors for- Returns:
- collection of postprocessors
-
isCacheable
Description copied from interface:ViewElementLookupRegistry
If the result of a certain mode is cacheable, this means that an externalEntityViewElementBuilderService
can store back the results of a type lookup or builder creation. Usually aViewElementBuilder
can be cached.- Specified by:
isCacheable
in interfaceViewElementLookupRegistry
- Parameters:
mode
- to check for- Returns:
- true if a builder can be cached
-
isEmpty
public boolean isEmpty()Description copied from interface:ViewElementLookupRegistry
Checks whether any lookup values have been applied to the registry.- Specified by:
isEmpty
in 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:
clone
in interfaceViewElementLookupRegistry
- Overrides:
clone
in classObject
- Returns:
- cloned instance
-