private static OptionHolder constructOptionHolder(StreamDefinition streamDefinition,
                                                      Annotation annotation,
                                                      io.siddhi.annotation.Extension extension,
                                                      String[] supportedDynamicOptions,
                                                      boolean supportDeploymentOptions) {
        List<String> supportedDynamicOptionList = new ArrayList<>();
        if (supportedDynamicOptions != null) {
            supportedDynamicOptionList = Arrays.asList(supportedDynamicOptions);
        }

        Map<String, String> options = new HashMap<>();
        Map<String, String> dynamicOptions = new HashMap<>();
        for (Element element : annotation.getElements()) {
            if (element.getKey().startsWith("dep:")) {
                if (!supportDeploymentOptions) {
                    throw new SiddhiAppCreationException("DeploymentOption is not supported by '" +
                            extension.namespace() + ":" + extension.name() + "', but a deployment property '" +
                            element.getKey() + "' is configured",
                            annotation.getQueryContextStartIndex(), annotation.getQueryContextEndIndex());
                }
            }
            if (Pattern.matches("(.*?)\\{\\{.*?\\}\\}(.*?)", element.getValue())) {
                if (supportedDynamicOptionList.contains(element.getKey())) {
                    dynamicOptions.put(element.getKey(), element.getValue());
                } else {
                    throw new SiddhiAppCreationException("'" + element.getKey() + "' is not a supported " +
                            "DynamicOption " + "for the Extension '" + extension.namespace() + ":" + extension.name() +
                            "', it only supports following as its DynamicOptions: " + supportedDynamicOptionList,
                            annotation.getQueryContextStartIndex(), annotation.getQueryContextEndIndex());
                }
            } else {
                options.put(element.getKey(), element.getValue());
            }
        }
        return new OptionHolder(streamDefinition, options, dynamicOptions, extension);
    }
Utility class for queryParser to help with QueryRuntime
generation.
modules/siddhi-core/src/main/java/io/siddhi/core/util/parser/helper/DefinitionParserHelper.java