Search in sources :

Example 1 with IntPropertyParser

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

the class SchemaProperty method getIntPropertyParser.

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

Example 2 with IntPropertyParser

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

the class StructrIntegerProperty method deserialize.

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

Aggregations

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