public interface ApiElement<E extends ApiElement<?>> extends Closeable
Closeable
implementation
for an optional highlighting the tree structure in the source code.HtmlElement
Modifier and Type | Method and Description |
---|---|
E |
addCDATA(CharSequence charData)
Add a character data in
CDATA format to XML only. |
E |
addComment(CharSequence comment)
Add a comment text.
|
E |
addElement(String name)
Create a new
XmlElement for a required name and add it to children. |
E |
addRawText(Object value)
Add an native text with no escaped characters, for example: XML code, JavaScript, CSS styles
|
E |
addText(Object value)
Add a text and escape special character
|
void |
close()
Close the element
|
String |
getName()
Get an element name
|
default E |
setAttrib(String name,
Object value)
Deprecated.
Call a method
setAttribute(java.lang.String, java.lang.Object) rather. |
E |
setAttribute(String name,
Object value)
Set an attribute
|
@Nonnull E addElement(@Nonnull String name)
XmlElement
for a required name and add it to children.name
- A name of the new XmlElement is required.@Nonnull E setAttribute(@Nonnull String name, @Nullable Object value)
name
- Required element namevalue
- The null
value is silently ignored. Formatting is performed by the
XmlWriter#writeValue(java.lang.Object, org.ujorm.tools.dom.XmlElement, java.lang.String, java.io.Writer)
method, where the default implementation calls a toString()
only.@Deprecated @Nonnull default E setAttrib(@Nonnull String name, @Nullable Object value)
setAttribute(java.lang.String, java.lang.Object)
rather.@Nonnull E addText(@Nullable Object value)
value
- The null
value is allowed. Formatting is performed by the
XmlWriter#writeValue(java.lang.Object, org.ujorm.tools.dom.XmlElement, java.lang.String, java.io.Writer)
method, where the default implementation calls a toString()
only.@Nonnull E addRawText(@Nullable Object value)
value
- The null
value is ignored.@Nonnull E addComment(@Nullable CharSequence comment)
comment
- A comment text must not contain a string -->
.@Nonnull E addCDATA(@Nullable CharSequence charData)
CDATA
format to XML only.
The CDATA structure isn't really for HTML at all.charData
- A text including the final DATA sequence. An empty argument is ignored.void close()
close
in interface AutoCloseable
close
in interface Closeable
Copyright 2019-2022, Pavel Ponec