You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
218 lines
3.6 KiB
Java
218 lines
3.6 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.datacatalogue.metadatadiscovery;
|
|
|
|
import javax.xml.bind.annotation.XmlAccessType;
|
|
import javax.xml.bind.annotation.XmlAccessorType;
|
|
import javax.xml.bind.annotation.XmlElement;
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
|
|
/**
|
|
*
|
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
* May 27, 2016
|
|
*/
|
|
@XmlRootElement(name="metadatafield")
|
|
@XmlAccessorType(XmlAccessType.FIELD)
|
|
public class MetadataField {
|
|
|
|
private String fieldName;
|
|
private Boolean mandatory = false;
|
|
private Boolean isBoolean = false;
|
|
private String defaulValue;
|
|
private String note;
|
|
|
|
//It's the list of eligible values;
|
|
@XmlElement(name = "vocabulary")
|
|
private MetadataVocabulary vocabulary;
|
|
|
|
@XmlElement(name = "validator")
|
|
private MetadataValidator validator;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public MetadataField() {
|
|
}
|
|
|
|
|
|
/**
|
|
* @param fieldName
|
|
* @param mandatory
|
|
* @param isBoolean
|
|
* @param defaulValue
|
|
* @param note
|
|
* @param vocabulary
|
|
* @param validator
|
|
*/
|
|
public MetadataField(
|
|
String fieldName, Boolean mandatory, Boolean isBoolean,
|
|
String defaulValue, String note, MetadataVocabulary vocabulary,
|
|
MetadataValidator validator) {
|
|
|
|
this.fieldName = fieldName;
|
|
this.mandatory = mandatory;
|
|
this.isBoolean = isBoolean;
|
|
this.defaulValue = defaulValue;
|
|
this.note = note;
|
|
this.vocabulary = vocabulary;
|
|
this.validator = validator;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return the fieldName
|
|
*/
|
|
public String getFieldName() {
|
|
|
|
return fieldName;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return the mandatory
|
|
*/
|
|
public Boolean getMandatory() {
|
|
|
|
return mandatory;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return the isBoolean
|
|
*/
|
|
public Boolean isBoolean() {
|
|
|
|
return isBoolean;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return the defaulValue
|
|
*/
|
|
public String getDefaulValue() {
|
|
|
|
return defaulValue;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return the note
|
|
*/
|
|
public String getNote() {
|
|
|
|
return note;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return the vocabulary
|
|
*/
|
|
public MetadataVocabulary getVocabulary() {
|
|
|
|
return vocabulary;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return the validator
|
|
*/
|
|
public MetadataValidator getValidator() {
|
|
|
|
return validator;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param fieldName the fieldName to set
|
|
*/
|
|
public void setFieldName(String fieldName) {
|
|
|
|
this.fieldName = fieldName;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param mandatory the mandatory to set
|
|
*/
|
|
public void setMandatory(Boolean mandatory) {
|
|
|
|
this.mandatory = mandatory;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param isBoolean the isBoolean to set
|
|
*/
|
|
public void setIsBoolean(Boolean isBoolean) {
|
|
|
|
this.isBoolean = isBoolean;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param defaulValue the defaulValue to set
|
|
*/
|
|
public void setDefaulValue(String defaulValue) {
|
|
|
|
this.defaulValue = defaulValue;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param note the note to set
|
|
*/
|
|
public void setNote(String note) {
|
|
|
|
this.note = note;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param vocabulary the vocabulary to set
|
|
*/
|
|
public void setVocabulary(MetadataVocabulary vocabulary) {
|
|
|
|
this.vocabulary = vocabulary;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param validator the validator to set
|
|
*/
|
|
public void setValidator(MetadataValidator validator) {
|
|
|
|
this.validator = validator;
|
|
}
|
|
|
|
|
|
/* (non-Javadoc)
|
|
* @see java.lang.Object#toString()
|
|
*/
|
|
@Override
|
|
public String toString() {
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
builder.append("CkanMetadata [fieldName=");
|
|
builder.append(fieldName);
|
|
builder.append(", mandatory=");
|
|
builder.append(mandatory);
|
|
builder.append(", isBoolean=");
|
|
builder.append(isBoolean);
|
|
builder.append(", defaulValue=");
|
|
builder.append(defaulValue);
|
|
builder.append(", note=");
|
|
builder.append(note);
|
|
builder.append(", vocabulary=");
|
|
builder.append(vocabulary);
|
|
builder.append(", validator=");
|
|
builder.append(validator);
|
|
builder.append("]");
|
|
return builder.toString();
|
|
}
|
|
|
|
|
|
}
|