public class Template extends Script
Script.ScriptField, Script.ScriptParseException
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<R>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_LANG
Default templating language
|
DEFAULT_TYPE
EMPTY_PARAMS
Constructor and Description |
---|
Template(StreamInput in) |
Template(java.lang.String template)
Constructor for simple inline template.
|
Template(java.lang.String template,
ScriptService.ScriptType type,
java.lang.String lang,
XContentType xContentType,
java.util.Map<java.lang.String,java.lang.Object> params)
Constructor for Template.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doWriteTo(StreamOutput out) |
boolean |
equals(java.lang.Object obj) |
XContentType |
getContentType()
Method for getting the
XContentType of the template. |
int |
hashCode() |
static Script |
parse(java.util.Map<java.lang.String,java.lang.Object> config,
boolean removeMatchedEntries,
ParseFieldMatcher parseFieldMatcher) |
static Template |
parse(XContentParser parser,
java.util.Map<java.lang.String,ScriptService.ScriptType> additionalTemplateFieldNames,
ParseFieldMatcher parseFieldMatcher)
Deprecated.
|
static Template |
parse(XContentParser parser,
java.util.Map<java.lang.String,ScriptService.ScriptType> additionalTemplateFieldNames,
java.lang.String defaultLang,
ParseFieldMatcher parseFieldMatcher)
Deprecated.
|
static Template |
parse(XContentParser parser,
ParseFieldMatcher parseFieldMatcher) |
protected XContentBuilder |
scriptFieldToXContent(java.lang.String template,
ScriptService.ScriptType type,
XContentBuilder builder,
ToXContent.Params builderParams) |
public static final java.lang.String DEFAULT_LANG
public Template(java.lang.String template)
template
- The inline template.public Template(java.lang.String template, ScriptService.ScriptType type, @Nullable java.lang.String lang, @Nullable XContentType xContentType, @Nullable java.util.Map<java.lang.String,java.lang.Object> params)
template
- The cache key of the template to be compiled/executed. For
inline templates this is the actual templates source code. For
indexed templates this is the id used in the request. For on
file templates this is the file name.type
- The type of template -- dynamic, indexed, or file.lang
- The language of the template to be compiled/executed.xContentType
- The XContentType
of the template.params
- The map of parameters the template will be executed with.public Template(StreamInput in) throws java.io.IOException
java.io.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
public XContentType getContentType()
XContentType
of the template.XContentType
of the template.protected XContentBuilder scriptFieldToXContent(java.lang.String template, ScriptService.ScriptType type, XContentBuilder builder, ToXContent.Params builderParams) throws java.io.IOException
scriptFieldToXContent
in class Script
java.io.IOException
public static Script parse(java.util.Map<java.lang.String,java.lang.Object> config, boolean removeMatchedEntries, ParseFieldMatcher parseFieldMatcher)
public static Template parse(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws java.io.IOException
java.io.IOException
@Deprecated public static Template parse(XContentParser parser, java.util.Map<java.lang.String,ScriptService.ScriptType> additionalTemplateFieldNames, ParseFieldMatcher parseFieldMatcher) throws java.io.IOException
java.io.IOException
@Deprecated public static Template parse(XContentParser parser, java.util.Map<java.lang.String,ScriptService.ScriptType> additionalTemplateFieldNames, java.lang.String defaultLang, ParseFieldMatcher parseFieldMatcher) throws java.io.IOException
java.io.IOException