class TransformProcess implements VectorProcess {

    public static List<Definition> toDefinition(String definition) {
        List<Definition> list = new ArrayList<Definition>();
        HashSet<String> check = new HashSet<String>();

        // clean up cross platform differences of line feed
        String[] defs = splitDefinitions(definition);

        for (String line : defs) {
            int mark = line.indexOf("=");
            if (mark != -1) {
                String name = line.substring(0, mark).trim();
                String expressionDefinition = line.substring(mark + 1).trim();

                if (check.contains(name)) {
                    throw new IllegalArgumentException("Attribute " + name
                            + " defined more than once");
                }
                Expression expression;
                try {
                    expression = ECQL.toExpression(expressionDefinition);
                } catch (CQLException e) {
                    throw new IllegalArgumentException("Unable to parse expression " + name + "="
                            + expressionDefinition + " " + e, e);
                }
                Definition def = new Definition();
                def.name = name;
                def.expression = expression;
                list.add(def);
                check.add(name); // to catch duplicates!
            }
        }
        return list;
    }

}