2018-06-27 12:29:21 +02:00
|
|
|
package eu.eudat.models.data.components.commons.datafield;
|
2017-11-30 11:10:42 +01:00
|
|
|
|
2022-04-18 17:38:58 +02:00
|
|
|
import eu.eudat.logic.utilities.helpers.FieldFactory;
|
2018-06-27 12:29:21 +02:00
|
|
|
import eu.eudat.logic.utilities.interfaces.XmlSerializable;
|
2017-11-30 11:10:42 +01:00
|
|
|
import org.w3c.dom.Document;
|
|
|
|
import org.w3c.dom.Element;
|
|
|
|
|
2019-02-25 17:46:16 +01:00
|
|
|
import java.util.Map;
|
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public abstract class FieldData<T> implements XmlSerializable<T> {
|
|
|
|
private String label;
|
|
|
|
|
|
|
|
public String getLabel() {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLabel(String label) {
|
|
|
|
this.label = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public T fromData(Object data) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-04-18 17:38:58 +02:00
|
|
|
public T fromData(Object data, String subType) {
|
|
|
|
return (T) FieldFactory.fromData(subType, data);
|
|
|
|
}
|
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public Object toData() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Element toXml(Document doc) {
|
|
|
|
return null;
|
|
|
|
}
|
2017-11-30 11:10:42 +01:00
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public T fromXml(Element item) {
|
|
|
|
return null;
|
|
|
|
}
|
2019-02-25 17:46:16 +01:00
|
|
|
|
|
|
|
public abstract Map<String, Object> toMap(Element item);
|
2017-11-30 11:10:42 +01:00
|
|
|
}
|