/** * {@inheritDoc} */ public DDay createProperty(final List<Parameter> params, final String value) throws ParseException { return new DDay(params, unescape(value)); }
/** * @param description unstructured time of death */ public DDay(String description) { super(Id.DDAY); this.text = description; getParameters().add(Value.TEXT); }
/** * {@inheritDoc} */ @Override public void validate() throws ValidationException { // ; Only value parameter allowed assertOneOrLess(Parameter.Id.VALUE); if (getParameters().size() > 1) { throw new ValidationException("Illegal parameter count"); } for (Parameter param : getParameters()) { if (!Value.TEXT.equals(param)) { throw new ValidationException("Illegal parameter [" + param.getId() + "]"); } } }
/** * {@inheritDoc} */ @Override public String getValue() { if (Value.TEXT.equals(getParameter(Parameter.Id.VALUE))) { return text; } return Strings.valueOf(date); }
/** * {@inheritDoc} */ @Override public void validate() throws ValidationException { // ; Only value parameter allowed assertOneOrLess(Parameter.Id.VALUE); if (getParameters().size() > 1) { throw new ValidationException("Illegal parameter count"); } for (Parameter param : getParameters()) { if (!Value.TEXT.equals(param)) { throw new ValidationException("Illegal parameter [" + param.getId() + "]"); } } }
/** * {@inheritDoc} */ @Override public String getValue() { if (Value.TEXT.equals(getParameter(Parameter.Id.VALUE))) { return text; } return Strings.valueOf(date); }
/** * Factory constructor. * @param params property parameters * @param value string representation of a property value * @throws ParseException where the specified value is not a valid date representation */ public DDay(List<Parameter> params, String value) throws ParseException { super(Id.DDAY, params); if (Value.TEXT.equals(getParameter(Parameter.Id.VALUE))) { this.text = value; } else { try { this.date = new Date(value); } catch (ParseException e) { this.date = new DateTime(value); } } }
/** * {@inheritDoc} */ public DDay createProperty(final List<Parameter> params, final String value) throws ParseException { return new DDay(params, unescape(value)); }
/** * @param description unstructured time of death */ public DDay(String description) { super(Id.DDAY); this.text = description; getParameters().add(Value.TEXT); }
/** * Factory constructor. * * @param params property parameters * @param value string representation of a property value * @throws ParseException where the specified value is not a valid date representation */ public DDay(List<Parameter> params, String value) throws ParseException { super(Id.DDAY, params); if (Value.TEXT.equals(getParameter(Parameter.Id.VALUE))) { this.text = value; } else { try { this.date = new Date(value); } catch (ParseException e) { this.date = new DateTime(value); } } }