Search in sources :

Example 31 with FilterName

use of com.sldeditor.filter.v2.function.FilterName in project sldeditor by robward-scisys.

the class IsGreaterThan method getFilterConfiguration.

/**
 * Gets the filter configuration.
 *
 * @return the filter configuration
 */
@Override
public FilterName getFilterConfiguration() {
    FilterName filterName = new FilterName("PropertyIsGreaterThan", Boolean.class);
    filterName.addParameter(new FilterNameParameter("property", ExpressionTypeEnum.PROPERTY, Object.class));
    filterName.addParameter(new FilterNameParameter("expression", ExpressionTypeEnum.EXPRESSION, Object.class));
    return filterName;
}
Also used : FilterName(com.sldeditor.filter.v2.function.FilterName) FilterNameParameter(com.sldeditor.filter.v2.function.FilterNameParameter)

Example 32 with FilterName

use of com.sldeditor.filter.v2.function.FilterName in project sldeditor by robward-scisys.

the class IsLessThan method getFilterConfiguration.

/**
 * Gets the filter configuration.
 *
 * @return the filter configuration
 */
@Override
public FilterName getFilterConfiguration() {
    FilterName filterName = new FilterName("PropertyIsLessThan", Boolean.class);
    filterName.addParameter(new FilterNameParameter("property", ExpressionTypeEnum.PROPERTY, Object.class));
    filterName.addParameter(new FilterNameParameter("expression", ExpressionTypeEnum.EXPRESSION, Object.class));
    filterName.addParameter(new FilterNameParameter("matchCase", ExpressionTypeEnum.LITERAL, Boolean.class));
    return filterName;
}
Also used : FilterName(com.sldeditor.filter.v2.function.FilterName) FilterNameParameter(com.sldeditor.filter.v2.function.FilterNameParameter)

Example 33 with FilterName

use of com.sldeditor.filter.v2.function.FilterName in project sldeditor by robward-scisys.

the class FilterNodeTest method testSetName.

/**
 * Test method for
 * {@link com.sldeditor.filter.v2.expression.FilterNode#setName(java.lang.String)}.
 */
@Test
public void testSetName() {
    FilterNode node = new FilterNode();
    assertNull(node.getFilter());
    String name = "filtername";
    node.setName(name);
    String expected = name + " : " + Localisation.getString(ExpressionPanelv2.class, "FilterNode.filterNotSet");
    assertTrue(node.toString().compareTo(expected) == 0);
}
Also used : ExpressionPanelv2(com.sldeditor.filter.v2.expression.ExpressionPanelv2) FilterNode(com.sldeditor.filter.v2.expression.FilterNode) Test(org.junit.Test)

Example 34 with FilterName

use of com.sldeditor.filter.v2.function.FilterName in project sldeditor by robward-scisys.

the class FilterNameTest method testGetFilterName.

/**
 * Test method for {@link com.sldeditor.filter.v2.function.FilterName#FilterName(java.lang.String, java.lang.Class)}.
 * Test method for {@link com.sldeditor.filter.v2.function.FilterName#getFilterName()}.
 * Test method for {@link com.sldeditor.filter.v2.function.FilterName#getReturnType()}.
 * Test method for {@link com.sldeditor.filter.v2.function.FilterName#getParameterList()}.
 * Test method for {@link com.sldeditor.filter.v2.function.FilterName#getParameter(int)}.
 * Test method for {@link com.sldeditor.filter.v2.function.FilterName#addParameter(com.sldeditor.filter.v2.function.FilterNameParameter)}.
 */
@Test
public void testGetFilterName() {
    String filterName = "test filter";
    Class<?> returnType = String.class;
    FilterName f = new FilterName(filterName, returnType);
    assertTrue(filterName.compareTo(f.getFilterName()) == 0);
    assertEquals(returnType, f.getReturnType());
    FilterNameParameter p1 = new FilterNameParameter("parameter 1", ExpressionTypeEnum.LITERAL, Integer.class);
    f.addParameter(p1);
    assertEquals(1, f.getParameterList().size());
    assertEquals(null, f.getParameter(-1));
    assertEquals(null, f.getParameter(99));
    assertEquals(p1, f.getParameter(0));
}
Also used : FilterName(com.sldeditor.filter.v2.function.FilterName) FilterNameParameter(com.sldeditor.filter.v2.function.FilterNameParameter) Test(org.junit.Test)

Aggregations

FilterName (com.sldeditor.filter.v2.function.FilterName)33 FilterNameParameter (com.sldeditor.filter.v2.function.FilterNameParameter)30 Geometry (com.vividsolutions.jts.geom.Geometry)9 Date (java.util.Date)6 Filter (org.opengis.filter.Filter)4 Test (org.junit.Test)3 ExpressionPanelv2 (com.sldeditor.filter.v2.expression.ExpressionPanelv2)1 FilterNode (com.sldeditor.filter.v2.expression.FilterNode)1 FilterConfigInterface (com.sldeditor.filter.v2.function.FilterConfigInterface)1 List (java.util.List)1 BinaryComparisonAbstract (org.geotools.filter.BinaryComparisonAbstract)1 LogicFilterImpl (org.geotools.filter.LogicFilterImpl)1 Not (org.opengis.filter.Not)1 PropertyIsBetween (org.opengis.filter.PropertyIsBetween)1 PropertyIsLike (org.opengis.filter.PropertyIsLike)1 PropertyIsNull (org.opengis.filter.PropertyIsNull)1 BinarySpatialOperator (org.opengis.filter.spatial.BinarySpatialOperator)1 BinaryTemporalOperator (org.opengis.filter.temporal.BinaryTemporalOperator)1 BoundingBox (org.opengis.geometry.BoundingBox)1