Package org.geotools.filter

Examples of org.geotools.filter.FunctionImpl


                        public Function function(String name, List<Expression> args, Literal fallback) {
                            return function(new NameImpl(name), args, fallback);
                        }
                        public Function function(Name name, List<Expression> args, Literal fallback) {
                            if ("foo".equals(name.getLocalPart())) {
                                return new FunctionImpl() {
                                    @Override
                                    public Object evaluate(Object object, Class context) {
                                        return "theResult";
                                    }
                                };
View Full Code Here


                    function.setFallbackValue( fallback );
                }
                return function;
            }
            if(FunctionImpl.class.isAssignableFrom(clazz)) {
                FunctionImpl function = (FunctionImpl) clazz.newInstance();
                if(parameters != null){
                    function.setParameters( parameters );
                }
                if(fallback != null){
                    function.setFallbackValue( fallback );
                }
                return function;
            }
            //Function function = (Function) functionClass.newInstance();
            Constructor<Function> constructor = clazz.getConstructor( new Class[]{ List.class, Literal.class} );
View Full Code Here

                    right.accept(this, rightContext);
                }
            }
            else {
                // wrap both sides in "lower"
                FunctionImpl f = new FunctionImpl() {
                    {
                        functionName = new FunctionNameImpl("lower",
                                parameter("lowercase", String.class),
                                parameter("string", String.class));
                    }
                };
                f.setName("lower");
               
                f.setParameters(Arrays.asList(left));
                f.accept(this, Arrays.asList(leftContext));
               
                out.write(" " + type + " ");
               
                f.setParameters(Arrays.asList(right));
                f.accept(this, Arrays.asList(rightContext));
            }
           
        } catch (java.io.IOException ioe) {
            throw new RuntimeException(IO_ERROR, ioe);
        }
View Full Code Here

TOP

Related Classes of org.geotools.filter.FunctionImpl

Copyright © 2018 www.massapicom. 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.