Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.PropertyName.evaluate()


    public boolean isComplexType(final StepList attrXPath, final AttributeDescriptor featureType) {
        PropertyName attExp = FF.property(attrXPath.toString());
        Object type = attExp.evaluate(featureType);
        if (type == null) {
            type = attExp.evaluate(featureType);
            throw new IllegalArgumentException("path not found: " + attrXPath);
        }

        AttributeDescriptor node = (AttributeDescriptor) type;
        return node.getType() instanceof ComplexType;
View Full Code Here


                    }
                   
                    @SuppressWarnings("unchecked")
                    protected int compare( SimpleFeature feature1, SimpleFeature feature2, SortBy order){
                        PropertyName name = order.getPropertyName();
                        Comparable value1 = (Comparable) name.evaluate( feature1 );
                        Comparable value2 = (Comparable) name.evaluate( feature2 );

                        if(value1 == value2) {
                            return 0;
                        }
View Full Code Here

                   
                    @SuppressWarnings("unchecked")
                    protected int compare( SimpleFeature feature1, SimpleFeature feature2, SortBy order){
                        PropertyName name = order.getPropertyName();
                        Comparable value1 = (Comparable) name.evaluate( feature1 );
                        Comparable value2 = (Comparable) name.evaluate( feature2 );

                        if(value1 == value2) {
                            return 0;
                        }
                        if( order.getSortOrder() == SortOrder.ASCENDING ){
View Full Code Here

        //
        EAttribute eAttribute = eFeatureInfo.eGetAttribute(property.getPropertyName());

        // Going through evaluate ensures we get the proper result even
        // if the name has not been specified (convention -> the default geometry)
        AttributeDescriptor descriptor = (AttributeDescriptor) property.evaluate(featureType);
        if (descriptor instanceof GeometryDescriptor) {

            // Forward
            //
            return visitBinarySpatialOperator(filter, name, eAttribute,
View Full Code Here

        } else {
            final PropertyName PROPERTY = sortBy.getPropertyName();
            return new Comparator<SimpleFeature>() {
                @SuppressWarnings("unchecked")
                public int compare(SimpleFeature f1, SimpleFeature f2) {
                    Object value1 = PROPERTY.evaluate(f1, Comparable.class);
                    Object value2 = PROPERTY.evaluate(f2, Comparable.class);
                    if (value1 == null || value2 == null) {
                        return 0; // cannot perform comparison
                    }
                    if (value1 instanceof Comparable && value1.getClass().isInstance(value2)) {
View Full Code Here

            final PropertyName PROPERTY = sortBy.getPropertyName();
            return new Comparator<SimpleFeature>() {
                @SuppressWarnings("unchecked")
                public int compare(SimpleFeature f1, SimpleFeature f2) {
                    Object value1 = PROPERTY.evaluate(f1, Comparable.class);
                    Object value2 = PROPERTY.evaluate(f2, Comparable.class);
                    if (value1 == null || value2 == null) {
                        return 0; // cannot perform comparison
                    }
                    if (value1 instanceof Comparable && value1.getClass().isInstance(value2)) {
                        return ((Comparable<Object>) value1).compareTo(value2);
View Full Code Here

            return null;
        }

        PropertyName pn = lastPropertyName;
        if (pn != null && pn.getPropertyName().equals(name)) {
            return pn.evaluate(feature);
        } else {
            pn = FF.property(name);
            Object result = pn.evaluate(feature);
            lastPropertyName = pn;
            return result;
View Full Code Here

        PropertyName pn = lastPropertyName;
        if (pn != null && pn.getPropertyName().equals(name)) {
            return pn.evaluate(feature);
        } else {
            pn = FF.property(name);
            Object result = pn.evaluate(feature);
            lastPropertyName = pn;
            return result;
        }
    }
}
View Full Code Here

    @Override
    public Object evaluate(Object object) {
        PropertyName name = (PropertyName) getParameters().get(0);
        Object literal = getParameters().get(1).evaluate(null);
       
        Object o = name.evaluate(object);
        return o.equals(Converters.convert(literal, o.getClass()));
    }

}
View Full Code Here

                            }
                           
                            if ( name != null ) {
                                //check against fetaure type to make sure its
                                // a geometric type
                                AttributeDescriptor att = (AttributeDescriptor) name.evaluate(featureType);
                                if ( !( att instanceof GeometryDescriptor ) ) {
                                    throw new WFSException("Property " + name + " is not geometric", "InvalidParameterValue");
                                }
                            }
                           
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.