class DslDynamicFeature implements DynamicFeature {

    @Override
    public void configure(ResourceInfo resourceInfo, FeatureContext context) {
        Class<?> parametersClass[] = resourceInfo.getResourceMethod().getParameterTypes();
        for (int i = 0; i < parametersClass.length; i++) {
            Class<?> parameterClass = parametersClass[i];
            if (parameterClass.isAssignableFrom(JsonNode.class)) {
                Parameter[] parameters = resourceInfo.getResourceMethod().getParameters();
                final Parameter parameter = parameters[i];
                if (parameter != null) {
                    final Dsl dslAnnotation = parameter.getAnnotation(Dsl.class);
                    try {
                        if (dslAnnotation != null) {
                            context.register(new DslScannerFilter(dslAnnotation.value()));
                        }
                    } catch (IOException e) {
                        LOGGER.error(e);
                        throw new IllegalStateException("Can not initialize DslScannerFilter");
                    }
                }
            }
        }
    }

}