All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.tsl2.nano.h5.websocket.dialog.WSItem Maven / Gradle / Ivy

Go to download

TSL2 Framework Html5 Extensions (WebServer, Html5Presentation, RuleCover, BeanConfigurator, LogicTable-Sheet, Expression-Descriptors for Actions, Rules, URLs, Queries)

There is a newer version: 2.5.2
Show newest version
package de.tsl2.nano.h5.websocket.dialog;

import java.util.HashMap;
import java.util.Map;

import de.tsl2.nano.core.util.MapUtil;

public class WSItem implements IHtmlItem {

    private String tag;
    private String name;
    private Object value;
    private Map attributes;

    public WSItem(String tag, String name, Object value, Object...attrKeyValues) {
        this(tag, name, value, MapUtil.asMap(attrKeyValues));
    }

    public WSItem(String tag, String name, Object value, Map attributes) {
        this.tag = tag;
        this.name = name;
        this.value = value;
        this.attributes = attributes;

    }
    @Override
    public String getTag() {
        return tag;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public Object getValue() {
        return value;
    }

    @Override
    public Map getSpecificAttributes() {
        if (attributes == null)
            attributes = new HashMap<>();
        return attributes;
    }

    @Override
    public String getId() {
        return WSDialog.PREFIX_NAME + getTag() + "." + getName() + ".id";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy