protected String[] convert(Path<?> leftHandSide, Expression<?> rightHandSide, QueryMetadata metadata) {
        if (rightHandSide instanceof Operation) {
            Operation<?> operation = (Operation<?>) rightHandSide;
            if (operation.getOperator() == LuceneOps.PHRASE) {
                return operation.getArg(0).toString().split("\\s+");
            } else if (operation.getOperator() == LuceneOps.TERM) {
                return new String[] {operation.getArg(0).toString()};
            } else {
                throw new IllegalArgumentException(rightHandSide.toString());
            }
        } else if (rightHandSide instanceof ParamExpression<?>) {
            Object value = metadata.getParams().get(rightHandSide);
            if (value == null) {
                throw new ParamNotSetException((ParamExpression<?>) rightHandSide);
            }
            return convert(leftHandSide, value);

        } else if (rightHandSide instanceof Constant<?>) {
            return convert(leftHandSide, ((Constant<?>) rightHandSide).getConstant());
        } else {
            throw new IllegalArgumentException(rightHandSide.toString());
        }
    }
template method

@param leftHandSide left hand side
@param rightHandSide right hand side
@return results
querydsl-lucene3/src/main/java/com/querydsl/lucene3/LuceneSerializer.java