result = schema == null || schema.getConversionPattern() == null ? getLongValue().toString() : FormatUtils.format(getLongValue(), schema.getConversionPattern()); break; result = schema == null || schema.getConversionPattern() == null ? getDoubleValue().toString() : FormatUtils.format(getDoubleValue(), schema.getConversionPattern()); break; result = schema == null || schema.getConversionPattern() == null ? FormatUtils.format(getDateValue()) : FormatUtils.format(getDateValue(), false, schema.getConversionPattern()); break;
this.setLongValue(schema.getConversionPattern() == null ? Long.valueOf(value) : FormatUtils.parseNumber(value, schema.getConversionPattern()).longValue()); } catch (Exception pe) { exception = pe; this.setDoubleValue(schema.getConversionPattern() == null ? Double.valueOf(value) : FormatUtils.parseNumber(value, schema.getConversionPattern()).doubleValue()); } catch (Exception pe) { exception = pe; this.setDateValue(schema.getConversionPattern() == null ? FormatUtils.parseDate(value) : new Date(FormatUtils.parseDate(value, schema.getConversionPattern()).getTime())); } catch (Exception pe) { exception = pe;
@Override public PlainSchemaTO getPlainSchemaTO(final String key) { PlainSchema schema = plainSchemaDAO.find(key); if (schema == null) { throw new NotFoundException("Schema '" + key + "'"); } PlainSchemaTO schemaTO = new PlainSchemaTO(); schemaTO.setKey(schema.getKey()); schemaTO.setType(schema.getType()); schemaTO.setCipherAlgorithm(schema.getCipherAlgorithm()); schemaTO.setConversionPattern(schema.getConversionPattern()); schemaTO.setEnumerationKeys(schema.getEnumerationKeys()); schemaTO.setEnumerationValues(schema.getEnumerationValues()); schemaTO.setMandatoryCondition(schema.getMandatoryCondition()); schemaTO.setMimeType(schema.getMimeType()); schemaTO.setMultivalue(schema.isMultivalue()); schemaTO.setReadonly(schema.isReadonly()); schemaTO.setSecretKey(schema.getSecretKey()); schemaTO.setUniqueConstraint(schema.isUniqueConstraint()); labels(schema, schemaTO); schemaTO.setAnyTypeClass(schema.getAnyTypeClass() == null ? null : schema.getAnyTypeClass().getKey()); if (schema.getValidator() != null) { schemaTO.setValidator(schema.getValidator().getKey()); } return schemaTO; }