All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.elasticsearch.script.ScriptCompiler Maven / Gradle / Ivy

There is a newer version: 8.13.4
Show newest version
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */

package org.elasticsearch.script;

/**
 * Takes a Script definition and returns a compiled script factory
 */
public interface ScriptCompiler {

    /**
     * Takes a Script definition and returns a compiled script factory
     * @param script            the Script to compile
     * @param scriptContext     the ScriptContext defining how to compile the script
     * @param                the class of the compiled Script factory
     * @return                  a Script factory
     */
     T compile(Script script, ScriptContext scriptContext);

    ScriptCompiler NONE = new ScriptCompiler() {
        @Override
        public  T compile(Script script, ScriptContext scriptContext) {
            throw new UnsupportedOperationException();
        }
    };
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy