Class TemplateViewElement
java.lang.Object
com.foreach.across.modules.web.ui.ViewElementSupport
com.foreach.across.modules.web.ui.elements.TemplateViewElement
- All Implemented Interfaces:
MutableViewElement
,ViewElement
A
ViewElement
that simply renders as a custom template.
If no ViewElementSupport.getCustomTemplate()
is defined, this element will output nothing.- Author:
- Arne Vandamme
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.MutableViewElement
MutableViewElement.Functions
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.ViewElement
ViewElement.Wither<T extends ViewElement>, ViewElement.WitherGetter<T extends ViewElement,
U>, ViewElement.WitherRemover<T extends ViewElement>, ViewElement.WitherSetter<T extends ViewElement> -
Field Summary
-
Constructor Summary
ConstructorDescriptionTemplateViewElement
(String customTemplate) TemplateViewElement
(String name, String customTemplate) -
Method Summary
Modifier and TypeMethodDescriptionaddAttributes
(Map<String, Object> attributes) getAttribute
(String attributeName) <V> V
getAttribute
(String attributeName, Class<V> expectedType) boolean
hasAttribute
(String attributeName) remove
(ViewElement.WitherRemover... functions) Execute one or more remover functions.removeAttribute
(String attributeName) protected <V> V
returnIfType
(Object value, Class<V> elementType) set
(ViewElement.WitherSetter... setters) Execute one or more setter functions.setAttribute
(String attributeName, Object attributeValue) setAttributes
(@NonNull Map<String, Object> attributes) setElementType
(String elementType) Methods inherited from class com.foreach.across.modules.web.ui.ViewElementSupport
getCustomTemplate, getElementType, getName, setCustomTemplate, setName
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.ViewElement
get, matches
-
Field Details
-
ELEMENT_TYPE
- See Also:
-
-
Constructor Details
-
TemplateViewElement
-
TemplateViewElement
-
TemplateViewElement
public TemplateViewElement()
-
-
Method Details
-
setElementType
- Overrides:
setElementType
in classViewElementSupport
-
getAttributes
-
setAttributes
-
setAttribute
-
addAttributes
-
removeAttribute
-
getAttribute
-
getAttribute
-
hasAttribute
-
returnIfType
-
set
Description copied from interface:ViewElement
Execute one or more setter functions.- Specified by:
set
in interfaceMutableViewElement
- Specified by:
set
in interfaceViewElement
- Overrides:
set
in classViewElementSupport
- Parameters:
setters
- to execute- Returns:
- self
-
remove
Description copied from interface:ViewElement
Execute one or more remover functions. A remover is defined as a separate interface so implementations can both implement setter and remover at the same time.- Specified by:
remove
in interfaceMutableViewElement
- Specified by:
remove
in interfaceViewElement
- Overrides:
remove
in classViewElementSupport
- Parameters:
functions
- to execute- Returns:
- self
-