Class NoTag
java.lang.Object
com.webfirmframework.wffweb.tag.core.AbstractTagBase
com.webfirmframework.wffweb.tag.core.AbstractJsObject
com.webfirmframework.wffweb.tag.html.AbstractHtml
com.webfirmframework.wffweb.tag.htmlwff.NoTag
- All Implemented Interfaces:
TagBase
,Serializable
,Cloneable
- Direct Known Subclasses:
Blank
It's a tag which makes child content without any opening closing tag.
NB: Nesting NoTag is not recommended and it may cause strange behavior. We recommend TagContent enum for NoTag insertion in a tag instead of creating new NoTag object. insertBefore method in NoTag may not work as expected for now so its use is not recommended.
NB: Nesting NoTag is not recommended and it may cause strange behavior. We recommend TagContent enum for NoTag insertion in a tag instead of creating new NoTag object. insertBefore method in NoTag may not work as expected for now so its use is not recommended.
- Since:
- 1.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.webfirmframework.wffweb.tag.html.AbstractHtml
AbstractHtml.TagType
-
Field Summary
Fields inherited from class com.webfirmframework.wffweb.tag.html.AbstractHtml
noTagContentTypeHtml
Fields inherited from class com.webfirmframework.wffweb.tag.core.AbstractJsObject
wffBMDatas
-
Constructor Summary
ConstructorDescriptionNoTag
(AbstractHtml base, AbstractHtml... children) NoTag
(AbstractHtml base, String childContent) NoTag
(AbstractHtml base, String childContent, boolean contentTypeHtml) NoTag
(AbstractHtml base, Collection<? extends AbstractHtml> children) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(AbstractHtml child) addsAbstractHtml
s as children.void
addsAbstractHtml
s as children.void
addChildren
(List<AbstractHtml> children) addsAbstractHtml
s as children.<T> void
addInnerHtml
(boolean updateClient, SharedTagContent<T> sharedTagContent, SharedTagContent.ContentFormatter<T> formatter) Deprecated.this method is not allowed in NoTag or Blank class.gets child content<R extends AbstractHtml,
C>
Rgive
(BiFunction<R, C, R> consumer, C input) Deprecated.this method is not allowed in NoTag or Blank class.<T extends AbstractHtml>
TDeprecated.this method is not allowed in NoTag or Blank class.protected void
init()
invokes only once per objectboolean
boolean
removeChild
(AbstractHtml child) addsAbstractHtml
s as children.void
removeChild
(String child) removes the the child content.void
removeChildren
(List<AbstractHtml> children) addsAbstractHtml
s as children.boolean
removeSharedTagContent
(boolean removeContent) Deprecated.this method is not allowed in NoTag or Blank class.<T> void
subscribeTo
(boolean updateClient, SharedTagContent<T> sharedTagContent, SharedTagContent.ContentFormatter<T> formatter) Deprecated.this method is not allowed in NoTag or Blank class.Methods inherited from class com.webfirmframework.wffweb.tag.html.AbstractHtml
addAttributes, addAttributes, addAttributes, addChild, addInnerHtml, addInnerHtml, addInnerHtml, addInnerHtml, addInnerHtmls, addInnerHtmls, addWffData, appendChild, appendChildren, appendChildren, beforePrintStructure, beforeWritePrintStructureToOutputStream, beforeWritePrintStructureToWffBinaryMessageOutputStream, clone, clone, containsChild, deepClone, getAllNestedChildrenIncludingParent, getAttributeByName, getAttributeHtmlBytesCompressedByIndex, getAttributes, getCharset, getChildAt, getChildren, getChildren, getChildrenAsArray, getChildrenSize, getClosingTag, getDataWffId, getExactTagFromWffBMBytes, getFirstChild, getHtmlMiddleSB, getIndexByChild, getIndexByChild, getLastChild, getOpeningTag, getParent, getPrintStructure, getPrintStructure, getReadLock, getRootTag, getSharedData, getSharedObject, getSharedTagContent, getTagFromWffBMBytes, getTagFromWffBMBytes, getTagFromWffBMBytes, getTagName, getWffData, getWffObjects, getWriteLock, insertAfter, insertAfterIfPossible, insertBefore, insertBeforeIfPossible, internalId, isHtmlStartSBAsFirst, isSubscribedToSharedTagContent, loopThroughAllNestedChildren, prependChildren, removeAllChildren, removeAttributes, removeAttributes, removeAttributes, removeAttributes, removeAttributes, removeAttributes, removeChildren, removeChildren, removeWffData, replaceWith, replaceWithIfPossible, resetHierarchy, setCharset, setChildren, setDataWffId, setParent, setSharedData, setSharedDataIfNull, subscribeTo, subscribeTo, toBigHtmlString, toBigHtmlString, toBigOutputStream, toBigOutputStream, toBigOutputStream, toBigOutputStream, toBigOutputStream, toBigOutputStream, toBigOutputStream, toCompressedWffBMBytes, toCompressedWffBMBytesV2, toCompressedWffBMBytesV2, toHtmlString, toHtmlString, toHtmlString, toHtmlString, toHtmlString, toHtmlString, toOutputStream, toOutputStream, toOutputStream, toOutputStream, toOutputStream, toOutputStream, toOutputStream, toOutputStream, toOutputStream, toString, toWffBMBytes, toWffBMBytes, toWffBMBytes, toWffBMBytes, writePrintStructureToOutputStream, writePrintStructureToOutputStream, writePrintStructureToWffBinaryMessageOutputStream
Methods inherited from class com.webfirmframework.wffweb.tag.core.AbstractJsObject
addWffData, getWffData, removeWffData
Methods inherited from class com.webfirmframework.wffweb.tag.core.AbstractTagBase
equals, getData, hashCode, isModified, isRebuild, setData, setModified, setRebuild
-
Constructor Details
-
NoTag
- Parameters:
base
- i.e. parent tag of this tagchildren
- An array ofAbstractHtml
- Since:
- 1.0.0
-
NoTag
- Parameters:
base
- i.e. parent tag of this tagchildren
- An array ofAbstractHtml
- Since:
- 1.0.0
-
NoTag
- Parameters:
base
- i.e. parent tag of this tagchildContent
-- Since:
- 1.0.0
-
NoTag
- Parameters:
base
- i.e. parent tag of this tagchildContent
-contentTypeHtml
- true if the given childContent is HTML. by default it is false.- Since:
- 3.0.2
-
-
Method Details
-
init
protected void init()invokes only once per object- Since:
- 1.0.0
-
addChildren
addsAbstractHtml
s as children.- Parameters:
children
-- Since:
- 1.0.0
-
addChild
addsAbstractHtml
s as children.- Parameters:
child
-- Since:
- 1.0.0
-
removeChildren
addsAbstractHtml
s as children.- Parameters:
children
-- Since:
- 1.0.0
-
removeChild
addsAbstractHtml
s as children.- Overrides:
removeChild
in classAbstractHtml
- Parameters:
child
-- Returns:
- true if removed
- Since:
- 1.0.0
-
removeChild
removes the the child content.- Parameters:
child
-- Since:
- 1.0.0
-
addChild
addsAbstractHtml
s as children.- Parameters:
child
-- Since:
- 1.0.0
-
getChildContent
gets child content- Returns:
- Since:
- 1.0.0
-
isChildContentTypeHtml
public boolean isChildContentTypeHtml()- Returns:
- true if the child content is considered to be HTML
- Since:
- 3.0.2
-
give
Deprecated.this method is not allowed in NoTag or Blank class.Description copied from class:AbstractHtml
This method can avoid creating anonymous class coding.
Eg:
Div rootDiv = new Div(null, new Id("rootDivId")).<Div>give(parent -> { new Div(parent, new Id("parentDivId")).give(nestedTag1 -> { new Div(nestedTag1, new Id("child1")); new Div(nestedTag1, new Id("child2")); new Div(nestedTag1, new Id("child3")); }); }); System.out.println(rootDiv.toHtmlString());
produces
<div id="rootDivId"> <div id="parentDivId"> <div id="child1"></div> <div id="child2"></div> <div id="child3"></div> </div> </div>
- Overrides:
give
in classAbstractHtml
- Parameters:
consumer
- the consumer object- Returns:
- the same object on which give method is called.
-
give
Deprecated.this method is not allowed in NoTag or Blank class.Description copied from class:AbstractHtml
This method can avoid creating anonymous class coding.
Eg:
Div div = new Div(null, new Id("rootDivId")).give(TagContent::text, "Hello World"); System.out.println(div.toHtmlString());
produces
<div id="rootDivId">Hello World</div>
A mix of give methods will be
Div div = new Div(null).give(dv -> { new Span(dv).give(TagContent::text, "Hello World"); });
produces
<div> <span>Hello World</span> </div>
- Overrides:
give
in classAbstractHtml
input
- the object to be passed as second argument ofBiFunction#apply(Object, Object)
method.- Returns:
- the object which
BiFunction#apply(Object, Object)
returns which will be a subclass ofAbstractHtml
-