Class AbstractNodeViewElement
java.lang.Object
com.foreach.across.modules.web.ui.elements.ContainerViewElement
com.foreach.across.modules.web.ui.elements.AbstractNodeViewElement
- All Implemented Interfaces:
 HtmlViewElement,MutableViewElement,ViewElement
- Direct Known Subclasses:
 AbstractTextNodeViewElement,NodeViewElement
public abstract class AbstractNodeViewElement
extends ContainerViewElement
implements HtmlViewElement
Base class for a 
HtmlViewElement that supports child nodes.- Author:
 - Arne Vandamme
 - See Also:
 
- 
Nested Class Summary
Nested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.elements.HtmlViewElement
HtmlViewElement.FunctionsNested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.MutableViewElement
MutableViewElement.FunctionsNested 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
Fields inherited from class com.foreach.across.modules.web.ui.elements.ContainerViewElement
ELEMENT_TYPE - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionaddAttributes(Map<String, Object> attributes) addChild(@NonNull ViewElement element) Add a child to this container.addChildren(@NonNull Collection<? extends ViewElement> elements) Add a collection of children to this container.addCssClass(String... cssClass) addFirstChild(@NonNull ViewElement element) Adds a child as the first one to this container.apply(@NonNull Consumer<ContainerViewElement> consumer) Apply a consumer to this container.<U extends ViewElement>
AbstractNodeViewElementapplyUnsafe(@NonNull Consumer<U> consumer) Apply a consumer to this container.Remove all children from this container.<U> Uget(ViewElement.WitherGetter<?, U> function) Get a value from the element.getAttribute(String attributeName) <V,U extends V> 
UgetAttribute(String attributeName, Class<V> expectedType) @NonNull StringbooleanhasAttribute(String attributeName) booleanhasCssClass(String cssClass) remove(ViewElement.WitherRemover... functions) Execute one or more remover functions.removeAttribute(String attributeName) removeCssClass(String... cssClass) protected <V,U extends V> 
UreturnIfType(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) setCustomTemplate(String customTemplate) protected AbstractNodeViewElementsetElementType(String elementType) protected AbstractNodeViewElementsetTagName(@NonNull String tagName) Methods inherited from class com.foreach.across.modules.web.ui.elements.ContainerViewElement
elementStream, find, find, findAll, findAll, findAll, findOrSelf, findOrSelf, flatStream, getChildren, getCustomTemplate, getElementType, getName, hasChildren, removeAllFromTree, removeChild, removeFromTree, removeFromTreeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.foreach.across.modules.web.ui.ViewElement
getCustomTemplate, getElementType, getName, matches 
- 
Constructor Details
- 
AbstractNodeViewElement
 
 - 
 - 
Method Details
- 
addCssClass
- Specified by:
 addCssClassin interfaceHtmlViewElement
 - 
hasCssClass
- Specified by:
 hasCssClassin interfaceHtmlViewElement
 - 
removeCssClass
- Specified by:
 removeCssClassin interfaceHtmlViewElement
 - 
getAttributes
- Specified by:
 getAttributesin interfaceHtmlViewElement
 - 
setAttributes
- Specified by:
 setAttributesin interfaceHtmlViewElement
 - 
setAttribute
- Specified by:
 setAttributein interfaceHtmlViewElement
 - 
addAttributes
- Specified by:
 addAttributesin interfaceHtmlViewElement
 - 
removeAttribute
- Specified by:
 removeAttributein interfaceHtmlViewElement
 - 
getAttribute
- Specified by:
 getAttributein interfaceHtmlViewElement
 - 
getAttribute
- Specified by:
 getAttributein interfaceHtmlViewElement
 - 
hasAttribute
- Specified by:
 hasAttributein interfaceHtmlViewElement
 - 
setName
- Specified by:
 setNamein interfaceMutableViewElement- Overrides:
 setNamein classContainerViewElement- Returns:
 this.
 - 
setCustomTemplate
- Specified by:
 setCustomTemplatein interfaceMutableViewElement- Overrides:
 setCustomTemplatein classContainerViewElement- Returns:
 this.
 - 
setElementType
- Overrides:
 setElementTypein classContainerViewElement- Returns:
 this.
 - 
addChild
Description copied from class:ContainerViewElementAdd a child to this container.- Overrides:
 addChildin classContainerViewElement- Parameters:
 element- to add
 - 
addChildren
public AbstractNodeViewElement addChildren(@NonNull @NonNull Collection<? extends ViewElement> elements) Description copied from class:ContainerViewElementAdd a collection of children to this container.- Overrides:
 addChildrenin classContainerViewElement- Parameters:
 elements- to add
 - 
addFirstChild
Description copied from class:ContainerViewElementAdds a child as the first one to this container.- Overrides:
 addFirstChildin classContainerViewElement- Parameters:
 element- to add
 - 
clearChildren
Description copied from class:ContainerViewElementRemove all children from this container.- Overrides:
 clearChildrenin classContainerViewElement
 - 
apply
Description copied from class:ContainerViewElementApply a consumer to this container. Useful for providing extensions that wish to provide actions on the container itself.- Overrides:
 applyin classContainerViewElement- Parameters:
 consumer- to execute
 - 
applyUnsafe
public <U extends ViewElement> AbstractNodeViewElement applyUnsafe(@NonNull @NonNull Consumer<U> consumer) Description copied from class:ContainerViewElementApply a consumer to this container. Useful for providing extensions that wish to provide actions on the container itself. This method allows you to pass anyConsumerfor a genericViewElement. Note that if you pass a consumer for a type that is not compatible withContainerViewElement, you will receive class cast exceptions at runtime, hence the unsafe.- Overrides:
 applyUnsafein classContainerViewElement- Parameters:
 consumer- to execute
 - 
returnIfType
 - 
set
Description copied from interface:ViewElementExecute one or more setter functions.- Specified by:
 setin interfaceHtmlViewElement- Specified by:
 setin interfaceMutableViewElement- Specified by:
 setin interfaceViewElement- Overrides:
 setin classContainerViewElement- Parameters:
 setters- to execute- Returns:
 - self
 
 - 
remove
Description copied from interface:ViewElementExecute 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:
 removein interfaceHtmlViewElement- Specified by:
 removein interfaceMutableViewElement- Specified by:
 removein interfaceViewElement- Overrides:
 removein classContainerViewElement- Parameters:
 functions- to execute- Returns:
 - self
 
 - 
get
Description copied from interface:ViewElementGet a value from the element. UseViewElement.WitherGetter.as(Class)for compile time typing. Note that runtime type casting execptions will occur when using the wrong type.- Specified by:
 getin interfaceViewElement- Type Parameters:
 U- type of the expected return value- Parameters:
 function- that returns the value- Returns:
 - value
 
 - 
getTagName
- Specified by:
 getTagNamein interfaceHtmlViewElement
 - 
setTagName
- Returns:
 this.
 - 
getHtmlId
- Specified by:
 getHtmlIdin interfaceHtmlViewElement
 - 
setHtmlId
- Specified by:
 setHtmlIdin interfaceHtmlViewElement- Returns:
 this.
 
 -