public interface ApiElement<E extends ApiElement<?>> extends Closeable
Closeable implementation
for an optional highlighting the tree structure in the source code.| Modifier and Type | Field and Description |
|---|---|
static @Nullable String |
HIDDEN_NAME
A name of a hidden element
|
| Modifier and Type | Method and Description |
|---|---|
E |
addCDATA(@Nullable CharSequence charData)
Add a character data in
CDATA format to XML only. |
E |
addComment(@Nullable CharSequence comment)
Add a comment text.
|
E |
addElement(@NotNull String name)
Create a new
ApiElement for a required name and add it to children. |
E |
addRawText(@Nullable Object value)
Add an native text with no escaped characters, for example: XML code, JavaScript, CSS styles
|
E |
addText(@Nullable Object value)
Add a text and escape special character
|
E |
addTextTemplated(@Nullable CharSequence template,
Object... values)
Message template
|
void |
close()
Close the element
|
@NotNull String |
getName()
Get an element name
|
default E |
setAttrib(@NotNull String name,
@Nullable Object value)
Deprecated.
Call a method
setAttribute(java.lang.String, java.lang.Object) rather. |
E |
setAttribute(@NotNull String name,
@Nullable Object value)
Set an attribute
|
@Nullable static final @Nullable String HIDDEN_NAME
@NotNull @NotNull String getName()
@NotNull E addElement(@NotNull @NotNull String name)
ApiElement for a required name and add it to children.name - A name of the new XmlElement is required.@NotNull E setAttribute(@NotNull @NotNull String name, @Nullable @Nullable Object value)
name - Required element namevalue - The null value is silently ignored. Formatting is performed by the
AbstractWriter.writeValue(Object, ApiElement, String)
method, where the default implementation calls a toString() only.@Deprecated @NotNull default E setAttrib(@NotNull @NotNull String name, @Nullable @Nullable Object value)
setAttribute(java.lang.String, java.lang.Object) rather.@NotNull E addText(@Nullable @Nullable Object value)
value - The null value is allowed. Formatting is performed by the
AbstractWriter.writeValue(Object, ApiElement, String) }
method, where the default implementation calls a toString() only.@NotNull E addTextTemplated(@Nullable @Nullable CharSequence template, @NotNull Object... values)
template - Message template where parameters are marked by the {} symbolvalues - argument values@NotNull E addRawText(@Nullable @Nullable Object value)
value - The null value is ignored.@NotNull E addComment(@Nullable @Nullable CharSequence comment)
comment - A comment text must not contain a string --> .@NotNull E addCDATA(@Nullable @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 AutoCloseableclose in interface CloseableCopyright 2015, Pavel Ponec