Java Code Examples for org.geotools.filter.LiteralExpressionImpl#evaluate()

The following examples show how to use org.geotools.filter.LiteralExpressionImpl#evaluate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IntegerValues.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Integer) {
        this.value = (Integer) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Integer.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 
Example 2
Source File: TextAreaValues.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue != null) {
        if (aValue instanceof String) {
            this.value = (String) aValue;
        } else if (aValue instanceof LiteralExpressionImpl) {
            LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
            value = literal.evaluate(value, String.class);
        } else if ((aValue instanceof AttributeExpressionImpl)
                || (aValue instanceof FunctionExpressionImpl)
                || (aValue instanceof MathExpressionImpl)) {
            this.expression = (Expression) aValue;
        } else {
            this.value = aValue.toString();
        }
    }
}
 
Example 3
Source File: DoubleValues.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Double) {
        this.value = (Double) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Double.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 
Example 4
Source File: StringValues.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue != null) {
        if (aValue instanceof String) {
            this.value = (String) aValue;
        } else if (aValue instanceof LiteralExpressionImpl) {
            LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
            value = literal.evaluate(value, String.class);
        } else if ((aValue instanceof AttributeExpressionImpl)
                || (aValue instanceof FunctionExpressionImpl)
                || (aValue instanceof MathExpressionImpl)) {
            this.expression = (Expression) aValue;
        } else {
            this.value = aValue.toString();
        }
    }
}
 
Example 5
Source File: BooleanValues.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Boolean) {
        this.value = (Boolean) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Boolean.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 
Example 6
Source File: NumberValues.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Number) {
        this.value = (Number) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Number.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 
Example 7
Source File: FloatValues.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Float) {
        this.value = (Float) aValue;
    } else if (aValue instanceof Double) {
        this.value = ((Double) aValue).floatValue();
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Float.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}
 
Example 8
Source File: LongValues.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setValue(Object aValue) {
    this.value = null;
    this.expression = null;

    if (aValue instanceof Long) {
        this.value = (Long) aValue;
    } else if (aValue instanceof LiteralExpressionImpl) {
        LiteralExpressionImpl literal = (LiteralExpressionImpl) aValue;
        value = literal.evaluate(value, Long.class);
    } else if ((aValue instanceof AttributeExpressionImpl)
            || (aValue instanceof FunctionExpressionImpl)
            || (aValue instanceof MathExpressionImpl)) {
        this.expression = (Expression) aValue;
    }
}