public class Script extends java.lang.Object implements ToXContent, Writeable
Modifier and Type | Class and Description |
---|---|
static interface |
Script.ScriptField |
static class |
Script.ScriptParseException |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<R>
Modifier and Type | Field and Description |
---|---|
static ScriptService.ScriptType |
DEFAULT_TYPE |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
|
Script(StreamInput in) |
|
Script(java.lang.String script)
Constructor for simple inline script.
|
|
Script(java.lang.String script,
ScriptService.ScriptType type,
java.lang.String lang,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
Constructor for Script.
|
protected |
Script(java.lang.String script,
java.lang.String lang)
For sub-classes to use to override the default language
|
Modifier and Type | Method and Description |
---|---|
protected void |
doWriteTo(StreamOutput out) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getLang()
Method for getting language.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParams()
Method for getting the parameters.
|
java.lang.String |
getScript()
Method for getting the script.
|
ScriptService.ScriptType |
getType()
Method for getting the type.
|
int |
hashCode() |
static Script |
parse(java.util.Map<java.lang.String,java.lang.Object> config,
boolean removeMatchedEntries,
ParseFieldMatcher parseFieldMatcher) |
static Script |
parse(XContentParser parser,
ParseFieldMatcher parseFieldMatcher) |
protected XContentBuilder |
scriptFieldToXContent(java.lang.String script,
ScriptService.ScriptType type,
XContentBuilder builder,
ToXContent.Params builderParams) |
java.lang.String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params builderParams) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
public static final ScriptService.ScriptType DEFAULT_TYPE
public Script(java.lang.String script)
script
- The inline script to execute.protected Script(java.lang.String script, java.lang.String lang)
public Script(java.lang.String script, ScriptService.ScriptType type, @Nullable java.lang.String lang, @Nullable java.util.Map<java.lang.String,? extends java.lang.Object> params)
script
- The cache key of the script to be compiled/executed. For
inline scripts this is the actual script source code. For
indexed scripts this is the id used in the request. For on
file scripts this is the file name.type
- The type of script -- dynamic, indexed, or file.lang
- The language of the script to be compiled/executed.params
- The map of parameters the script will be executed with.public Script(StreamInput in) throws java.io.IOException
java.io.IOException
public final void writeTo(StreamOutput out) throws java.io.IOException
Writeable
protected void doWriteTo(StreamOutput out) throws java.io.IOException
java.io.IOException
public java.lang.String getScript()
public ScriptService.ScriptType getType()
public java.lang.String getLang()
public java.util.Map<java.lang.String,java.lang.Object> getParams()
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params builderParams) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
protected XContentBuilder scriptFieldToXContent(java.lang.String script, ScriptService.ScriptType type, XContentBuilder builder, ToXContent.Params builderParams) throws java.io.IOException
java.io.IOException
public static Script parse(java.util.Map<java.lang.String,java.lang.Object> config, boolean removeMatchedEntries, ParseFieldMatcher parseFieldMatcher)
public static Script parse(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws java.io.IOException
java.io.IOException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object