class VelocityAutotagRuntime extends Directive implements AutotagRuntime<Request> {

    @Override
    @SuppressWarnings("unchecked")
    public <T> T getParameter(String name, Class<T> type, T defaultValue) {
        if (params == null) {
            ASTMap astMap = (ASTMap) node.jjtGetChild(0);
            params = (Map<String, Object>) astMap.value(context);
        }
        T result = (T) params.get(name);
        if (result == null) {
            result = defaultValue;
        }
        return result;
    }

}