2017-11-27 14:40:16 +01:00
|
|
|
package models.components.datasetprofile;
|
|
|
|
|
2017-11-30 11:10:42 +01:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
|
|
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
|
|
|
|
|
|
|
import models.components.commons.DefaultValue;
|
|
|
|
import models.components.commons.Multiplicity;
|
|
|
|
import models.components.commons.ViewStyle;
|
|
|
|
import utilities.ModelDefinition;
|
|
|
|
import utilities.ViewStyleDefinition;
|
|
|
|
import utilities.builders.ModelBuilder;
|
|
|
|
|
|
|
|
public class Field implements ModelDefinition<entities.xmlmodels.modeldefinition.Field>,ViewStyleDefinition<entities.xmlmodels.viewstyledefinition.Field>{
|
2017-11-27 14:40:16 +01:00
|
|
|
private String id;
|
2017-11-30 11:10:42 +01:00
|
|
|
private int ordinal;
|
2017-11-27 14:40:16 +01:00
|
|
|
private String title;
|
|
|
|
private String value;
|
|
|
|
private String description;
|
|
|
|
private String extendedDescription;
|
2017-11-30 11:10:42 +01:00
|
|
|
private ViewStyle viewStyle;
|
|
|
|
private String datatype;
|
2017-11-27 14:40:16 +01:00
|
|
|
private boolean defaultVisibility;
|
|
|
|
private int page;
|
2017-11-30 11:10:42 +01:00
|
|
|
private DefaultValue defaultValue;
|
|
|
|
private Multiplicity multiplicity;
|
|
|
|
private Object data;
|
|
|
|
|
2017-11-27 14:40:16 +01:00
|
|
|
|
|
|
|
public String getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
public void setId(String id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
2017-11-30 11:10:42 +01:00
|
|
|
|
|
|
|
public int getOrdinal(){
|
|
|
|
return ordinal;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setOrdinal(int ordinal){
|
|
|
|
this.ordinal = ordinal;
|
|
|
|
}
|
2017-11-27 14:40:16 +01:00
|
|
|
public String getTitle() {
|
|
|
|
return title;
|
|
|
|
}
|
|
|
|
public void setTitle(String title) {
|
|
|
|
this.title = title;
|
|
|
|
}
|
|
|
|
public String getValue() {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
public void setValue(String value) {
|
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
public String getDescription() {
|
|
|
|
return description;
|
|
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
|
|
this.description = description;
|
|
|
|
}
|
|
|
|
public String getExtendedDescription() {
|
|
|
|
return extendedDescription;
|
|
|
|
}
|
|
|
|
public void setExtendedDescription(String extendedDescription) {
|
|
|
|
this.extendedDescription = extendedDescription;
|
|
|
|
}
|
2017-11-30 11:10:42 +01:00
|
|
|
public ViewStyle getViewStyle() {
|
2017-11-27 14:40:16 +01:00
|
|
|
return viewStyle;
|
|
|
|
}
|
2017-11-30 11:10:42 +01:00
|
|
|
public void setViewStyle(ViewStyle viewStyle) {
|
2017-11-27 14:40:16 +01:00
|
|
|
this.viewStyle = viewStyle;
|
|
|
|
}
|
|
|
|
public boolean isDefaultVisibility() {
|
|
|
|
return defaultVisibility;
|
|
|
|
}
|
|
|
|
public void setDefaultVisibility(boolean defaultVisibility) {
|
|
|
|
this.defaultVisibility = defaultVisibility;
|
|
|
|
}
|
|
|
|
public int getPage() {
|
|
|
|
return page;
|
|
|
|
}
|
|
|
|
public void setPage(int page) {
|
|
|
|
this.page = page;
|
2017-11-30 11:10:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public DefaultValue getDefaultValue() {
|
|
|
|
return defaultValue;
|
2017-11-27 14:40:16 +01:00
|
|
|
}
|
2017-11-30 11:10:42 +01:00
|
|
|
public void setDefaultValue(DefaultValue defaultValue) {
|
|
|
|
this.defaultValue = defaultValue;
|
|
|
|
}
|
|
|
|
public String getDatatype() {
|
|
|
|
return datatype;
|
|
|
|
}
|
|
|
|
public void setDatatype(String datatype) {
|
|
|
|
this.datatype = datatype;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Multiplicity getMultiplicity() {
|
|
|
|
return multiplicity;
|
|
|
|
}
|
|
|
|
public void setMultiplicity(Multiplicity multiplicity) {
|
|
|
|
this.multiplicity = multiplicity;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Object getData() {
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
public void setData(Object data) {
|
|
|
|
this.data = data;
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public entities.xmlmodels.modeldefinition.Field toDatabaseDefinition(entities.xmlmodels.modeldefinition.Field field) {
|
|
|
|
field.setDatatype(this.datatype);
|
|
|
|
field.setDefaultValue(this.defaultValue);
|
|
|
|
field.setId(this.id);
|
|
|
|
field.setMultiplicity(this.multiplicity);
|
|
|
|
field.setOrdinal(this.ordinal);
|
|
|
|
return field;
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void fromDatabaseDefinition(entities.xmlmodels.modeldefinition.Field item) {
|
|
|
|
this.datatype = item.getDatatype();
|
|
|
|
this.defaultValue = item.getDefaultValue();
|
|
|
|
this.multiplicity = item.getMultiplicity();
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public entities.xmlmodels.viewstyledefinition.Field toDatabaseDefinition(entities.xmlmodels.viewstyledefinition.Field field) {
|
|
|
|
field.setDefaultVisibility(this.defaultVisibility);
|
|
|
|
field.setDescription(this.description);
|
|
|
|
field.setExtendedDescription(this.extendedDescription);
|
|
|
|
field.setId(this.id);
|
|
|
|
field.setOrdinal(this.ordinal);
|
|
|
|
field.setTitle(this.title);
|
|
|
|
field.setViewStyle(this.viewStyle);
|
|
|
|
field.setData(new ModelBuilder().toFieldData(data, this.viewStyle.getRenderStyle()));
|
|
|
|
return field;
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void fromDatabaseDefinition(entities.xmlmodels.viewstyledefinition.Field item) {
|
|
|
|
this.defaultVisibility = item.isDefaultVisibility();
|
|
|
|
this.description = item.getDescription();
|
|
|
|
this.extendedDescription = item.getExtendedDescription();
|
|
|
|
this.id = item.getId();
|
|
|
|
this.ordinal = item.getOrdinal();
|
|
|
|
this.title = item.getTitle();
|
|
|
|
this.viewStyle = item.getViewStyle();
|
|
|
|
this.data = item.getData();
|
|
|
|
}
|
2017-11-27 14:40:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
}
|