public String getDisplayString() { if (this instanceof CustomDatatype) { return ((CustomDatatype)this).getName(); } else if (getBuiltin() != null) { return getBuiltin().getDescriptorName(); } else { return getValueType().getSimpleName(); } }
public String getString(V value) throws InvalidValueException { if (value == null) return ""; if (!isValid(value)) { throw new InvalidValueException("Value is not valid: " + value); } return value.toString(); }
<VT> Builtin(String descriptorName, AbstractDatatype<VT> datatype) { datatype.setBuiltin(this); // Protected, we actually want this to be immutable this.descriptorName = descriptorName; this.datatype = datatype; }
@Override public boolean isHandlingJavaType(Class type) { return getValueType().isAssignableFrom(type); }
public boolean isValid(V value) { return value == null || getValueType().isAssignableFrom(value.getClass()); }
public String getDisplayString() { if (this instanceof CustomDatatype) { return ((CustomDatatype)this).getName(); } else if (getBuiltin() != null) { return getBuiltin().getDescriptorName(); } else { return getValueType().getSimpleName(); } }
@Override public boolean isHandlingJavaType(Class type) { return getValueType().isAssignableFrom(type); }
<VT> Builtin(String descriptorName, AbstractDatatype<VT> datatype) { datatype.setBuiltin(this); // Protected, we actually want this to be immutable this.descriptorName = descriptorName; this.datatype = datatype; }
public String getString(V value) throws InvalidValueException { if (value == null) return ""; if (!isValid(value)) { throw new InvalidValueException("Value is not valid: " + value); } return value.toString(); }
public String getDisplayString() { if (this instanceof CustomDatatype) { return ((CustomDatatype)this).getName(); } else if (getBuiltin() != null) { return getBuiltin().getDescriptorName(); } else { return getValueType().getSimpleName(); } }
public boolean isValid(V value) { return value == null || getValueType().isAssignableFrom(value.getClass()); }
<VT> Builtin(String descriptorName, AbstractDatatype<VT> datatype) { datatype.setBuiltin(this); // Protected, we actually want this to be immutable this.descriptorName = descriptorName; this.datatype = datatype; }
public String getString(V value) throws InvalidValueException { if (value == null) return ""; if (!isValid(value)) { throw new InvalidValueException("Value is not valid: " + value); } return value.toString(); }
@Override public boolean isHandlingJavaType(Class type) { return getValueType().isAssignableFrom(type); }
public boolean isValid(V value) { return value == null || getValueType().isAssignableFrom(value.getClass()); }