Search in sources :

Example 1 with DoublePropertyParser

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

the class StructrNumberProperty method deserialize.

@Override
void deserialize(final SchemaProperty property) {
    super.deserialize(property);
    final DoublePropertyParser doublePropertyParser = property.getDoublePropertyParser();
    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 : DoublePropertyParser(org.structr.schema.parser.DoublePropertyParser)

Example 2 with DoublePropertyParser

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

the class SchemaProperty method getDoublePropertyParser.

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

Aggregations

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