de.tsl2.nano.h5.websocket.dialog.IHtmlItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tsl2.nano.h5 Show documentation
Show all versions of tsl2.nano.h5 Show documentation
TSL2 Framework Html5 Extensions (WebServer, Html5Presentation, RuleCover, BeanConfigurator, LogicTable-Sheet, Expression-Descriptors for Actions, Rules, URLs, Queries)
package de.tsl2.nano.h5.websocket.dialog;
import java.util.HashMap;
import java.util.Map;
public interface IHtmlItem {
String getTag();
String getId();
String getName();
Object getValue();
Map getSpecificAttributes();
default boolean hasLabel() { return true;}
default String getContent() {return null;}
default Map getAttributes() {
Map attrs = new HashMap<>();
attrs.put("id", getId());
attrs.put("name", getName());
attrs.put("value", String.valueOf(getValue()));
getSpecificAttributes().keySet().stream().forEach(k -> attrs.put(k, String.valueOf(getSpecificAttributes().get(k))));
return attrs;
}
default String toHtml() {
return null;
}
}