Search in sources :

Example 1 with DoubleArrayPropertyParser

use of org.structr.schema.parser.DoubleArrayPropertyParser in project structr by structr.

the class StructrNumberArrayProperty method deserialize.

@Override
void deserialize(final SchemaProperty property) {
    super.deserialize(property);
    final DoubleArrayPropertyParser doublePropertyParser = property.getDoubleArrayPropertyParser();
    if (doublePropertyParser != null) {
        this.exclusiveMinimum = doublePropertyParser.isLowerExclusive();
        this.exclusiveMaximum = doublePropertyParser.isUpperExclusive();
        final Number min = doublePropertyParser.getLowerBound();
        if (min != null) {
            this.minimum = min.doubleValue();
        }
        final Number max = doublePropertyParser.getUpperBound();
        if (max != null) {
            this.maximum = max.doubleValue();
        }
    }
}
Also used : DoubleArrayPropertyParser(org.structr.schema.parser.DoubleArrayPropertyParser)

Example 2 with DoubleArrayPropertyParser

use of org.structr.schema.parser.DoubleArrayPropertyParser in project structr by structr.

the class SchemaProperty method getDoubleArrayPropertyParser.

public DoubleArrayPropertyParser getDoubleArrayPropertyParser() {
    if (doubleArrayPropertyParser == null) {
        try {
            doubleArrayPropertyParser = new DoubleArrayPropertyParser(new ErrorBuffer(), getName(), this);
            doubleArrayPropertyParser.getPropertySource(new StringBuilder(), getProperty(SchemaProperty.schemaNode));
        } catch (FrameworkException fex) {
            logger.warn("", fex);
        }
    }
    return doubleArrayPropertyParser;
}
Also used : ErrorBuffer(org.structr.common.error.ErrorBuffer) FrameworkException(org.structr.common.error.FrameworkException) DoubleArrayPropertyParser(org.structr.schema.parser.DoubleArrayPropertyParser)

Aggregations

DoubleArrayPropertyParser (org.structr.schema.parser.DoubleArrayPropertyParser)2 ErrorBuffer (org.structr.common.error.ErrorBuffer)1 FrameworkException (org.structr.common.error.FrameworkException)1