class FilterFunction_setCRS extends FunctionExpressionImpl {

    public Object evaluate(Object feature) {
        Geometry geom;
        CoordinateReferenceSystem crs;

        try { // attempt to get value and perform conversion
            geom = (Geometry) getExpression(0).evaluate(feature, Geometry.class);
        } catch (Exception e) // probably a type error
        {
            throw new IllegalArgumentException(
                    "Expected argument of type Geometry for argument #0");
        }
        
        try { // try to parse the SRS
            crs = getExpression(1).evaluate(feature, CoordinateReferenceSystem.class);
            if(crs == null) {
                String srs = getExpression(1).evaluate(feature, String.class);
                try {
                    crs = CRS.decode(srs);
                } catch(FactoryException e) {
                    crs = CRS.parseWKT(srs);
                }
            }
        } catch(Exception e) {
            throw new IllegalArgumentException(
                    "Expected argument of type CoordinateReferenceSystem, WKT or valid EPSG code for argument #1");
        }

        if(geom != null) {
            geom.setUserData(crs);
        }
        
        return geom;
    }

    public  FilterFunction_setCRS();

}