Search in sources :

Example 1 with NullPropertyToken

use of org.structr.common.error.NullPropertyToken in project structr by structr.

the class ValidatedNode method nonEmpty.

protected boolean nonEmpty(Property<String> property, ErrorBuffer errorBuffer) {
    String value = getProperty(property);
    boolean valid = true;
    if (value == null) {
        errorBuffer.add(new NullPropertyToken(getClass().getSimpleName(), property));
        valid = false;
    } else if (value.isEmpty()) {
        errorBuffer.add(new EmptyPropertyToken(getClass().getSimpleName(), property));
        valid = false;
    }
    return valid;
}
Also used : NullPropertyToken(org.structr.common.error.NullPropertyToken) EmptyPropertyToken(org.structr.common.error.EmptyPropertyToken)

Aggregations

EmptyPropertyToken (org.structr.common.error.EmptyPropertyToken)1 NullPropertyToken (org.structr.common.error.NullPropertyToken)1