Class ViewElementBuilderSupport<T extends MutableViewElement,SELF extends ViewElementBuilder<T>>
java.lang.Object
com.foreach.across.modules.web.ui.ViewElementBuilderSupport<T,SELF>
- Type Parameters:
T
- resultingViewElement
SELF
- return type for builder methods
- All Implemented Interfaces:
ViewElementBuilder<T>
- Direct Known Subclasses:
AbstractVoidNodeViewElementBuilder
,ContainerViewElementBuilderSupport
,TextViewElementBuilder
,ViewElementGeneratorBuilder
public abstract class ViewElementBuilderSupport<T extends MutableViewElement,SELF extends ViewElementBuilder<T>>
extends Object
implements ViewElementBuilder<T>
Base class for a
ViewElementBuilder
of a MutableViewElement
. Provides defaults functionality
like configuring a custom templates or a set of post processors.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Encapsulates either aViewElement
orViewElementBuilder
for fetching within aViewElementBuilderContext
.Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.ViewElementBuilder
ViewElementBuilder.Wither<T extends ViewElementBuilder>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected T
apply
(T viewElement, ViewElementBuilderContext builderContext) final T
build
(ViewElementBuilderContext builderContext) Builds the element using a specificViewElementBuilderContext
.Execute a consumer that applies some configuration to this builder.protected abstract T
createElement
(ViewElementBuilderContext builderContext) customTemplate
(String template) elementSupplier
(Function<ViewElementBuilderContext, ? extends T> supplierFunction) Set a separate supplier which supplies the initial element to which this builder should be applied.elementSupplier
(Supplier<? extends T> supplier) Set a separate supplier which supplies the initial element to which this builder should be applied.protected final T
postProcess
(ViewElementBuilderContext builderContext, T viewElement) postProcessor
(ViewElementPostProcessor<T> postProcessor) protected void
registerWebResources
(WebResourceRegistry webResourceRegistry) Method to implement if web resources should be registered.with
(ViewElement.WitherSetter... setters) Apply a collection of setters to the element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.foreach.across.modules.web.ui.ViewElementBuilder
andThen, build, doWith, map, map, postProcess, postProcess
-
Field Details
-
name
-
customTemplate
-
-
Constructor Details
-
ViewElementBuilderSupport
public ViewElementBuilderSupport()
-
-
Method Details
-
elementSupplier
Set a separate supplier which supplies the initial element to which this builder should be applied.- Parameters:
supplier
- to use instead of callingcreateElement(ViewElementBuilderContext)
- Returns:
- current builder
-
elementSupplier
Set a separate supplier which supplies the initial element to which this builder should be applied.- Parameters:
supplierFunction
- to use instead of callingcreateElement(ViewElementBuilderContext)
- Returns:
- current builder
-
with
Apply a collection of setters to the element. -
name
-
customTemplate
-
configure
Execute a consumer that applies some configuration to this builder. Useful if you do not want to break a fluent api style of coding. The consumer is called immediately if it is notnull
. -
postProcessor
-
build
Builds the element using a specificViewElementBuilderContext
.- Specified by:
build
in interfaceViewElementBuilder<T extends MutableViewElement>
- Parameters:
builderContext
- provides the context for this build event- Returns:
- element created and post processed
-
createElement
-
registerWebResources
Method to implement if web resources should be registered. Will only be called if there is aWebResourceRegistry
present in the current (thread local) context.- Parameters:
webResourceRegistry
- to add entries to
-
apply
-
postProcess
-