Class AbstractTemplate
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BeanHandlerprotected Map<String,InternalValue> protected Stringprotected List<ResourceBundle>protected TemplateEncoderprotected Stringprotected Stringprotected Map<String,InternalString> protected TemplateInitializerprotected Stringprotected List<ResourceBundle> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddGeneratedValue(String valueId) Registers a value IDs as being generated by RIFE2.final voidaddGeneratedValues(Collection<String> valueIds) Registers a collection of value IDs as being generated by RIFE2.final voidaddResourceBundle(ResourceBundle resourceBundle) Adds a resource bundle to this template.final voidaddResourceBundles(Collection<ResourceBundle> resourceBundles) Adds a list of resource bundles to this template.final voidappendBlock(String valueBlockId) Appends the content of a block to a value.final voidappendBlock(String valueId, String blockId) Appends the content of a block to a value.protected abstract booleanappendBlockExternalForm(String id, ExternalValue result) protected abstract booleanappendBlockInternalForm(String id, InternalValue result) protected abstract booleanappendDefaultValueExternalForm(String id, ExternalValue result) protected abstract booleanappendDefaultValueInternalForm(String id, InternalValue result) protected voidappendTextInternal(InternalValue value, CharSequence text) final voidappendValue(String id, boolean value) Appends"true"or"false"to the specified value in this template, depending on the givenvalue.final voidappendValue(String id, char value) Appends the single specified character to the specified value in this template.final voidappendValue(String id, char[] value) Appends the given characters to the specified value in this template.final voidappendValue(String id, char[] value, int offset, int count) Appends the specified range of the given character string to the specified value in this template.final voidappendValue(String id, double value) Appends the given double precision floating point value to the specified value in this template.final voidappendValue(String id, float value) Appends the given floating point value to the specified value in this template.final voidappendValue(String id, int value) Appends the given integer to the specified value in this template.final voidappendValue(String id, long value) Appends the given long to the specified value in this template.final voidappendValue(String id, Object value) Appends the result of callingString.valueOfon the givenvalueto the specified value in this template.final voidappendValue(String id, String value) Appends the given string, or an empty string ifvalueisnull, to the specified value in this template.final voidappendValueEncoded(String id, Object value) Appends the result of callingString.valueOfon the givenvalueto the specified value in this template and encodes it with theTemplateEncoderthat's registered for this templateprotected final voidappendValueExternalForm(String id, String tag, ExternalValue result) protected final voidappendValueInternalForm(String id, String tag, InternalValue result) final voidblankValue(String id) Set the content of the specified value to an empty string.final voidclear()Resets all values in this template and removes any resource bundles.clone()Returns a shallow copy of this template, with the same values.final intReturns the number of values in this template which have been set.final InternalValueReturns an anonymous value that can be used to construct complex content for use within this template.Creates a new template, using the same factory, name and encoding as those that were used to create this template instance.Fills all values in this template which match "l10n:key", where "key" is a key in a resource bundle registered for this template.Fills the value "lang:id" with the value of the block "lang:id:langid", where "id" is the given ID, and "langid" is this template's current language ID.Evaluates all values in this template with ID's of the form "render:class" or "render:class:differentiatorr", where "class" is the fully-qualified name of a class which extendsValueRenderer, the result of callingValueRenderer.renderon a new instance of the class.getAttribute(String name) Returns the data of an attribute that was set in this template instance.Returns the name and data of all attributes that have been set in this template instance.abstract String[]Returns a list of the ID's of all values present in this template, including set and unset values.final BeanHandlerReturns this template's bean handler.Returns the evaluated content of the specified block as a text.final StringReturns the entire content of the template and finalize all non evaluated values.Returns this template's default content type, for exampletext/html.abstract StringReturns the original text of the specified value, before any modification that may have been made usingTemplate.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)or similar methods.final List<CharSequence>Returns the content of the specified block as a list with all the individual parts.final List<CharSequence>Returns the content of this template as a list with all the individual parts.final TemplateEncoderReturns the encoder that this template uses to convert strings to values in the template's generated text output.final StringReturns the encoding of this the content of this template.final StringReturns the unique identifier of the factory that was used to instantiate this template.abstract String[]getFilteredBlock(String filter, String id) Returns the matched data of a block that matched a particular filter at template compilation.abstract Collection<String[]>getFilteredBlocks(String filter) Each template type supports a set of special block tags that are used for adding automated features like localization, config value setting, ...abstract String[]getFilteredValue(String filter, String id) Returns the matched data of a value that matched a particular filter at template compilation.abstract Collection<String[]>getFilteredValues(String filter) Each template type supports a set of special value tags that are used for adding automated features like authentication, localization, value rendering, config value setting, ...final FormBuilderReturns this template's form builder.Returns this template's current 2-letter language code.abstract longReturns when the file corresponding to this template was modified, in milliseconds since the Unix epoch.final List<ResourceBundle>Returns a list of the resource bundles used by this template.abstract Collection<String>Returns a collection of the ID's of all values in this template which have not been set.final StringReturns the current content of the specified value as a string.getValueOrAttribute(String name) Returns the content of a value or the data of an attribute with a particular name.booleanhasAttribute(String name) Checks whether an attribute exists in this template instance.final booleanReturns whether this template contains a block with the given ID.booleanReturns whether a default value was specified in this template for the specified value.abstract booleanhasFilteredBlocks(String filter) Returns whether any block matched a particular filter at template compilation.abstract booleanhasFilteredValues(String filter) Returns whether any value matched a particular filter at template compilation.final booleanReturns whether this template has any resource bundles registered.abstract booleanhasValueId(String id) Returns whether this template contains a value with the given ID.protected voidincreasePartsCapacityInternal(InternalValue value, int size) protected voidincreaseValuesCapacityInternal(InternalValue value, int size) protected static booleanisTemplateClassModified(URL templateResource, long templateModificationTime, Map<URL, Long> templateDependencies, String templateModificationState, ResourceFinder resourceFinder, String modificationState) final booleanReturns whether the specified value has been generated by RIFE2.final booleanisValueSet(String id) Returns whether the specified value has been set.protected final StringvoidremoveAttribute(String name) Removes an attribute from this template instance.voidremoveBean(Object bean) Reverts all values to their defaults when the identifiers match properties of the given bean, whether those values were set with a previous call tosetBean.voidremoveBean(Object bean, String prefix) Reverts all values to their defaults when the identifiers match properties of the given bean preceded by the given prefix, whether or not those values were set with a previous call tosetBean.final voidReverts the generated values back to their default value.final voidremoveValue(String id) Reverts the specified value back to its default value.final voidremoveValues(Collection<String> ids) Reverts the specified values back to their default value.voidsetAttribute(String name, Object value) Sets an attribute that will be associated with this template instance.voidsetAttributes(Map<String, Object> map) Sets the given attributes to the corresponding data.voidSets all values in this template whose identifiers match names of properties in the given bean.voidSets all values in this template whose names match names of properties in the given bean, preceded by the given prefix.voidSets all values in this template whose names match names of properties in the given bean, preceded by the given prefix, if present.final voidReplaces the specified value with the content of the specified block.final voidReplaces the specified value with the content of the specified block.voidsetDefaultContentType(String defaultContentType) voidsetLanguage(String lang) Sets this template's current language code, such as "en".final voidSets the specified value in this template totrueorfalsedepending on the givenvalue.final voidSets the specified value in this template to the single specified character.final voidSets the specified value in this template to the given characters.final voidSets the specified value in this template to the specified range of the given character string.final voidSets the specified value in this template to the given double precision floating point value.final voidSets the specified value in this template to the given floating point value.final voidSets the specified value in this template to the given integer.final voidSets the specified value in this template to the given long.final voidsetValue(String id, CharSequence value) Sets the specified value in this template to the given character sequence, or an empty character sequence ifvalueisnull.final voidSets the specified value in this template to the result of callingString.valueOfon the givenvalue.final voidSets the specified value in this template to the given string, or an empty string ifvalueisnull.final voidsetValue(String id, List<CharSequence> deferredContent) Sets the specified value in this template to content that's structured in the internal format.final voidsetValue(String id, InternalValue internalValue) Sets the specified value in this template to the value of the given internal value.final voidSets the specified value in this template to the current content of the given template.final voidsetValueEncoded(String id, Object value) Sets the specified value in this template to the result of callingString.valueOfon the givenvalueand encodes it with theTemplateEncoderthat's registered for this templatefinal voidwrite(OutputStream out) This method is a shorthand forTemplate.writeContent(OutputStream).voidwriteBlock(String id, OutputStream out) Writes the evaluated contents of the specified block to the given output stream, usingUTF-8encoding.voidwriteBlock(String id, OutputStream out, String charsetName) final voidwriteContent(OutputStream out) Writes the complete evaluated template content to the given stream, using UTF-8 encoding.final voidwriteContent(OutputStream out, String charsetName) Writes the complete evaluated template content to the given stream, using the specified charset for encoding.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface rife.template.Template
getDependencies, getFullName, getName
-
Field Details
-
factoryIdentifier_
-
encoding_
-
initializer_
-
generatedValues_
-
fixedValues_
-
constructedValues_
-
beanHandler_
-
encoder_
-
defaultResourceBundles_
-
resourceBundles_
-
attributes_
-
language_
-
defaultContentType_
-
-
Constructor Details
-
AbstractTemplate
protected AbstractTemplate()
-
-
Method Details
-
appendBlock
Description copied from interface:TemplateAppends the content of a block to a value. The values used by the block will be captured when this method is called, so any future changes to template values will not affect text which was appended when this method is called.- Specified by:
appendBlockin interfaceTemplate- Parameters:
valueBlockId- the ID of the value and the block- See Also:
-
appendBlock
Description copied from interface:TemplateAppends the content of a block to a value. The values used by the block will be captured when this method is called, so any future changes to template values will not affect text which was appended when this method is called.- Specified by:
appendBlockin interfaceTemplate- Parameters:
valueId- the ID of the valueblockId- the ID of the block- Throws:
TemplateException- when thevalueIdorblockIdaren't known- See Also:
-
setBlock
Description copied from interface:TemplateReplaces the specified value with the content of the specified block. The values used by the block will be captured when this method is called, so any future changes to template values will not affect the specified value text.- Specified by:
setBlockin interfaceTemplate- Parameters:
valueBlockId- the ID of the value and the block- Throws:
TemplateException- when thevalueIdorblockIdaren't known- See Also:
-
setBlock
Description copied from interface:TemplateReplaces the specified value with the content of the specified block. The values used by the block will be captured when this method is called, so any future changes to template values will not affect the specified value text.- Specified by:
setBlockin interfaceTemplate- Parameters:
valueId- the ID of the valueblockId- the ID of the block- Throws:
TemplateException- when thevalueIdorblockIdaren't known- See Also:
-
getBlock
Description copied from interface:TemplateReturns the evaluated content of the specified block as a text.- Specified by:
getBlockin interfaceTemplate- Parameters:
id- the ID of the block in the template- Returns:
- the evaluated textual content of the specified block
- Throws:
TemplateException- when the block ID isn't known- See Also:
-
getContent
Description copied from interface:TemplateReturns the entire content of the template and finalize all non evaluated values. The content is the root block with has an empty string as identifier.Values without content will either use their default value if it has been provided, or the tag that was used to declare the value will be output as-is.
All specialized tags will also be evaluated (resource bundle localization, block localization, value renderers, ...).
- Specified by:
getContentin interfaceTemplate- Returns:
- the entire textual content of the template
- Throws:
TemplateException- when an error occurred during the processing of the specialized tags- See Also:
-
writeBlock
Description copied from interface:TemplateWrites the evaluated contents of the specified block to the given output stream, usingUTF-8encoding.- Specified by:
writeBlockin interfaceTemplate- Parameters:
id- the ID of the blockout- the stream to write to- Throws:
IOException- when errors occur during the manipulation of the output streamTemplateException- when the block ID isn't known- See Also:
-
writeBlock
public void writeBlock(String id, OutputStream out, String charsetName) throws IOException, TemplateException - Throws:
IOExceptionTemplateException
-
writeContent
Description copied from interface:TemplateWrites the complete evaluated template content to the given stream, using UTF-8 encoding.- Specified by:
writeContentin interfaceTemplate- Parameters:
out- the stream to which the template contents should be written- Throws:
IOException- when errors occur during the manipulation of the output streamTemplateException- when an error occurs during the template content evaluation- See Also:
-
writeContent
public final void writeContent(OutputStream out, String charsetName) throws IOException, TemplateException Description copied from interface:TemplateWrites the complete evaluated template content to the given stream, using the specified charset for encoding.- Specified by:
writeContentin interfaceTemplate- Parameters:
out- the stream to which the template contents should be writtencharsetName- the name of the charset to use- Throws:
IOException- when errors occur during the manipulation of the output stream; orwhen the character set isn't valid
TemplateException- when an error occurs during the template content evaluation- See Also:
-
write
Description copied from interface:TemplateThis method is a shorthand forTemplate.writeContent(OutputStream).- Specified by:
writein interfaceTemplate- Parameters:
out- the stream to which the template contents should be written- Throws:
IOException- when errors occur during the manipulation of the output stream; orwhen the character set isn't valid
TemplateException- when an error occurs during the template content evaluation- See Also:
-
getDeferredBlock
Description copied from interface:TemplateReturns the content of the specified block as a list with all the individual parts.This list is the internal representation of all content with placeholders for the values that aren't filled in yet. This structure is mainly used internally by the framework. The list structure also makes it possible to optimize performance and memory usage.
- Specified by:
getDeferredBlockin interfaceTemplate- Parameters:
id- the ID of a block in this template- Returns:
- a list of the contents of the specified block
- Throws:
TemplateException- if no such block exists; orif an error occurred during the retrieval
- See Also:
-
getDeferredContent
Description copied from interface:TemplateReturns the content of this template as a list with all the individual parts.This list is the internal representation of all content with placeholders for the values that aren't filled in yet. This structure is mainly used internally by the framework. The list structure also makes it possible to optimize performance and memory usage.
- Specified by:
getDeferredContentin interfaceTemplate- Returns:
- a list of the contents of this template
- Throws:
TemplateException- if an error occurred during the retrieval- See Also:
-
evaluateRenderTags
Description copied from interface:TemplateEvaluates all values in this template with ID's of the form "render:class" or "render:class:differentiatorr", where "class" is the fully-qualified name of a class which extendsValueRenderer, the result of callingValueRenderer.renderon a new instance of the class. The class must contain a zero-argument ("no-arg") constructor.For example, given a class
MyRendererin the package "org.rifers.something", which extendsValueRenderer, a value "render:org.rifers.something.MyRenderer:test" would create a new instance ofMyRenderer(using its no-arg constructor), callrender(this, "render:org.rifers.something.MyRenderer:test", "test"), and set the value in this template to whatever value the call returns.Value renderer tags are evaluated automatically when the content is generated. You can manually call this method to force evaluation of the tags at any time.
- Specified by:
evaluateRenderTagsin interfaceTemplate- Returns:
- the list of names of the template values that were generated
- Throws:
TemplateException- if a class in a render tag cannot be instantiated
-
evaluateL10nTags
Description copied from interface:TemplateFills all values in this template which match "l10n:key", where "key" is a key in a resource bundle registered for this template. Each value will be filled with the value in the resource bundle with the corresponding key.This method is normally called automatically during template initialization. You should call it if you wish to re-evaluate the tags at any time during the template's life.
- Specified by:
evaluateL10nTagsin interfaceTemplate- Returns:
- the list of names of the template values that were generated
-
evaluateLangTags
Description copied from interface:TemplateFills the value "lang:id" with the value of the block "lang:id:langid", where "id" is the given ID, and "langid" is this template's current language ID.If no matching block for the current language is found, the content of the specified value will not be modified.
This method is called automatically when the output is generated (such as when calling
Template.getContent()). You can manually call this method to force evaluation of the tags earlier than that.- Specified by:
evaluateLangTagsin interfaceTemplate- Parameters:
id- the ID whose language tag should be filled with the appropriate block- Returns:
- the list of names of the template values that were generated
-
createInternalValue
Description copied from interface:TemplateReturns an anonymous value that can be used to construct complex content for use within this template. SeeInternalValuefor details.The returned internal value is tied closely to the template it was obtained from, methods like
InternalValue.appendBlockreference blocks within this template.- Specified by:
createInternalValuein interfaceTemplate- Returns:
- a new internal value instance for constructing more complex parts of this template
- See Also:
-
setValue
Description copied from interface:TemplateSets the specified value in this template to content that's structured in the internal format.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatedeferredContent- content in the internal format- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the value of the given internal value.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templateinternalValue- an internal value,nullset the value content to blank content- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the current content of the given template. The given template's value will be evaluated immediately, instead of being stored to be evaluated later.If the given template is
null, the specified value will be set to an empty string.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatetemplate- a template- Throws:
TemplateException- if the specified value ID does not exist in this template; orif an error occurred during the evaluation of the template parameter
- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the result of callingString.valueOfon the givenvalue.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- an object- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template totrueorfalsedepending on the givenvalue.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a boolean value- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the single specified character.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a character- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the given characters. The given value must not benull.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a string of characters- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the specified range of the given character string. The specified number of bytes fromvaluewill be used, starting at the character specified byoffset.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a character stringoffset- the index invalueof the first character to usecount- the number of characters to use- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the given double precision floating point value. This method uses the String.valueOf method to print the given value, which probably prints more digits than you like. You probably wantString.formatorNumberFormatinstead.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a floating point value- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the given floating point value. This method uses the String.valueOf method to print the given value, which probably prints more digits than you like. You probably wantString.formatorNumberFormatinstead.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a floating point value- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the given integer.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- an integer- Throws:
TemplateException- if the specified value does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the given long.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a long- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the given string, or an empty string ifvalueisnull.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a string, ornull- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValue
Description copied from interface:TemplateSets the specified value in this template to the given character sequence, or an empty character sequence ifvalueisnull.- Specified by:
setValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a character sequence, ornull- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setValueEncoded
Description copied from interface:TemplateSets the specified value in this template to the result of callingString.valueOfon the givenvalueand encodes it with theTemplateEncoderthat's registered for this template- Specified by:
setValueEncodedin interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- an object to will be encoded- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
setBean
Description copied from interface:TemplateSets all values in this template whose identifiers match names of properties in the given bean.For example, given a class:
class Person { private String first; private String last; public String getFirstName() { return first; } public void setFirstName(String name) { this.first = name; } public String getLastName() { return last; } public void setLastName(String name) { this.last = name; }And given a template:
Hello <!--v firstName/--> <!--v lastName/-->.
Calling this method with an instance of Person where
firstwas "Jim" andlastwas "James", would produce:Hello Jim James.
Calling this method is equivalent to calling
setValueindividually for each property of the bean.This method uses this template's encoder to encode the bean properties before setting the values. To prevent this, use the other form of setBean.
Only bean properties will be considered for insertion in the template. This means only properties with a getter and a setter will be considered.
- Specified by:
setBeanin interfaceTemplate- Parameters:
bean- a bean whose properties will be used to fill in values in the template- Throws:
TemplateException- if this template has no bean handling capability; oran error occurred during the introspection of the bean
- See Also:
-
setBean
Description copied from interface:TemplateSets all values in this template whose names match names of properties in the given bean, preceded by the given prefix.For example, given a class:
class Person { private String first; private String last; public String getFirstName() { return first; } public void setFirstName(String name) { this.first = name; } public String getLastName() { return last; } public void setLastName(String name) { this.last = name; }And given a template:
Hello <!--v NAME:firstName/--> <!--v NAME:lastName/-->.
Calling this method with an instance of Person where
firstwas "Jim" andlastwas "James", and the prefix "NAME:", would produce:Hello Jim James.
Calling this method is equivalent to calling
setValueindividually for each property of the bean prefixed with the given prefix.This method uses this template's encoder to encode the bean properties before setting the values. To prevent this, use the other form of setBean.
Only bean properties will be considered for insertion in the template. This means only properties with a getter and a setter will be considered.
- Specified by:
setBeanin interfaceTemplate- Parameters:
bean- a bean whose properties will be used to fill in values in the templateprefix- the prefix of values which will be filled with the given bean's property values- Throws:
TemplateException- if this template has no bean handling capability; oran error occurred during the introspection of the bean
- See Also:
-
setBean
Description copied from interface:TemplateSets all values in this template whose names match names of properties in the given bean, preceded by the given prefix, if present. If the given prefix isnull, it is ignored.For example, given a class:
class Person { private String first; private String last; public String getFirstName() { return first; } public void setFirstName(String name) { this.first = name; } public String getLastName() { return last; } public void setLastName(String name) { this.last = name; }And given a template:
Hello <!--v NAME:firstName/--> <!--v NAME:lastName/-->.
Calling this method with an instance of Person where
firstwas "Jim" andlastwas "James", and the prefix "NAME:", would produce:Hello Jim James.
Calling this method is equivalent to calling
setValueindividually for each property of the bean prefixed with the given prefix.If
encodeistrue, this method will use this template's encoder to encode the bean properties before setting the values.Only bean properties will be considered for insertion in the template. This means only properties with a getter and a setter will be considered.
- Specified by:
setBeanin interfaceTemplate- Parameters:
bean- a bean whose properties will be used to fill in values in the templateprefix- the prefix of values which will be filled with the given bean's property valuesencode-trueif the bean property values have to be encoded; orfalseotherwise- Throws:
TemplateException- if this template has no bean handling capability; oran error occurred during the introspection of the bean
- See Also:
-
removeBean
Description copied from interface:TemplateReverts all values to their defaults when the identifiers match properties of the given bean, whether those values were set with a previous call tosetBean. The values of the bean's properties are ignored.Calling this method is equivalent to calling
removeValueonce for the name of each property of the given bean.- Specified by:
removeBeanin interfaceTemplate- Parameters:
bean- a bean- Throws:
TemplateException- if this template has no bean handling capability; oran error occurred during the introspection of the bean
- See Also:
-
removeBean
Description copied from interface:TemplateReverts all values to their defaults when the identifiers match properties of the given bean preceded by the given prefix, whether or not those values were set with a previous call tosetBean. The values of the bean's properties are ignored.Calling this method is equivalent to calling
removeValueonce for the name of each property of the given bean, prefixed with the given prefix.- Specified by:
removeBeanin interfaceTemplate- Parameters:
bean- a bean whose properties will be used to determine which values to remove from the templateprefix- a prefix- Throws:
TemplateException- if this template has no bean handling capability; oran error occurred during the introspection of the bean
- See Also:
-
appendValue
Description copied from interface:TemplateAppends the result of callingString.valueOfon the givenvalueto the specified value in this template.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- an object- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
Description copied from interface:TemplateAppends"true"or"false"to the specified value in this template, depending on the givenvalue.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a boolean value- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
Description copied from interface:TemplateAppends the single specified character to the specified value in this template.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a character- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
Description copied from interface:TemplateAppends the given characters to the specified value in this template. The given value must not benull.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a string of characters- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
public final void appendValue(String id, char[] value, int offset, int count) throws TemplateException Description copied from interface:TemplateAppends the specified range of the given character string to the specified value in this template. The specified number of bytes fromvaluewill be used, starting at the character specified byoffset.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a character stringoffset- the index invalueof the first character to usecount- the number of characters to use- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
Description copied from interface:TemplateAppends the given double precision floating point value to the specified value in this template. This method uses the String.valueOf method to print the given value, which probably prints more digits than you like. You probably wantString.formatorNumberFormatinstead.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a floating point value- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
Description copied from interface:TemplateAppends the given floating point value to the specified value in this template. This method uses the String.valueOf method to print the given value, which probably prints more digits than you like. You probably wantString.formatorNumberFormatinstead.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a floating point value- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
Description copied from interface:TemplateAppends the given integer to the specified value in this template.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- an integer- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
Description copied from interface:TemplateAppends the given long to the specified value in this template.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a long- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValue
Description copied from interface:TemplateAppends the given string, or an empty string ifvalueisnull, to the specified value in this template.- Specified by:
appendValuein interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- a string, ornull- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
appendValueEncoded
Description copied from interface:TemplateAppends the result of callingString.valueOfon the givenvalueto the specified value in this template and encodes it with theTemplateEncoderthat's registered for this template- Specified by:
appendValueEncodedin interfaceTemplate- Parameters:
id- the ID of the value in this templatevalue- an object to will be encoded- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
Template.appendValue(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
getValue
Description copied from interface:TemplateReturns the current content of the specified value as a string.- Specified by:
getValuein interfaceTemplate- Parameters:
id- the ID of a value in this template- Returns:
- the current content value of the specified value
- Throws:
TemplateException- if the specified value ID does not exist in this template- See Also:
-
getDefaultValue
Description copied from interface:TemplateReturns the original text of the specified value, before any modification that may have been made usingTemplate.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)or similar methods.If no default value was specified for the given value, this method will return
null.- Specified by:
getDefaultValuein interfaceTemplate- Parameters:
id- the ID of a value in this template, ornull- Returns:
- the original text value of the specified value
- See Also:
-
hasDefaultValue
Description copied from interface:TemplateReturns whether a default value was specified in this template for the specified value.- Specified by:
hasDefaultValuein interfaceTemplate- Parameters:
id- the ID of a value in this template- Returns:
- whether the specified value has a default value
- See Also:
-
getFilteredBlocks
Description copied from interface:TemplateEach template type supports a set of special block tags that are used for adding automated features like localization, config value setting, ... Instead of having to parse all template block identifiers each time these features are used, RIFE filters them out at template compilation and keeps them available in a separate collection.This method is mainly used by the framework itself, the supported filter regular expressions are available from
TemplateFactory.- Specified by:
getFilteredBlocksin interfaceTemplate- Parameters:
filter- a template factory regular expression- Returns:
- a list of captured groups for matching block ID's
- See Also:
-
hasFilteredBlocks
Description copied from interface:TemplateReturns whether any block matched a particular filter at template compilation.- Specified by:
hasFilteredBlocksin interfaceTemplate- Parameters:
filter- a template factory regular expression- Returns:
- whether any matching blocks exist in this template
- See Also:
-
getFilteredBlock
Description copied from interface:TemplateReturns the matched data of a block that matched a particular filter at template compilation.- Specified by:
getFilteredBlockin interfaceTemplate- Parameters:
filter- a template factory regular expressionid- the ID of matched block- Returns:
- the matched data; or
nullof no such filtered block was matched at template compilation time - See Also:
-
getFilteredValues
Description copied from interface:TemplateEach template type supports a set of special value tags that are used for adding automated features like authentication, localization, value rendering, config value setting, ... Instead of having to parse all template value identifiers each time these features are used, RIFE filters them out at template compilation and keeps them available in a separate collection.This method is mainly used by the framework itself, the supported filter regular expressions are available from
TemplateFactory.- Specified by:
getFilteredValuesin interfaceTemplate- Parameters:
filter- a template factory regular expression- Returns:
- a list of captured groups for matching value ID's
- See Also:
-
hasFilteredValues
Description copied from interface:TemplateReturns whether any value matched a particular filter at template compilation.- Specified by:
hasFilteredValuesin interfaceTemplate- Parameters:
filter- a template factory regular expression- Returns:
- whether any matching values exist in this template
- See Also:
-
getFilteredValue
Description copied from interface:TemplateReturns the matched data of a value that matched a particular filter at template compilation.- Specified by:
getFilteredValuein interfaceTemplate- Parameters:
filter- a template factory regular expressionid- the ID of matched value- Returns:
- the matched data; or
nullof no such filtered value was matched at template compilation time - See Also:
-
hasBlock
Description copied from interface:TemplateReturns whether this template contains a block with the given ID. -
isValueSet
Description copied from interface:TemplateReturns whether the specified value has been set. If this method returnsfalse, the value has its original default value.If no such value exists in this template, this method will not throw an exception, it will return
false.If the value was automatically set by RIFE2, this method will not return
true, butTemplate.isValueGenerated(java.lang.String)will.- Specified by:
isValueSetin interfaceTemplate- Parameters:
id- the ID of a value in this template- Returns:
- whether the specified value has been set
- See Also:
-
Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueGenerated(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
isValueGenerated
Description copied from interface:TemplateReturns whether the specified value has been generated by RIFE2. This values will not be return withTemplate.isValueSet(java.lang.String).If no such value exists in this template, this method will not throw an exception, it will return
false.- Specified by:
isValueGeneratedin interfaceTemplate- Parameters:
id- the ID of a value in this template- Returns:
- whether the specified value has been set
- See Also:
-
Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
addGeneratedValue
Description copied from interface:TemplateRegisters a value IDs as being generated by RIFE2.- Specified by:
addGeneratedValuein interfaceTemplate- Parameters:
valueId- the value ID to register as generated values- See Also:
-
addGeneratedValues
Description copied from interface:TemplateRegisters a collection of value IDs as being generated by RIFE2.- Specified by:
addGeneratedValuesin interfaceTemplate- Parameters:
valueIds- the value IDs to register as generated values- See Also:
-
countValues
public final int countValues()Description copied from interface:TemplateReturns the number of values in this template which have been set.- Specified by:
countValuesin interfaceTemplate- Returns:
- the number of values in this template which have been set
-
removeValue
Description copied from interface:TemplateReverts the specified value back to its default value.- Specified by:
removeValuein interfaceTemplate- Parameters:
id- the ID of a value in this template- See Also:
-
Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.hasValueId(java.lang.String)
-
removeValues
Description copied from interface:TemplateReverts the specified values back to their default value.- Specified by:
removeValuesin interfaceTemplate- Parameters:
ids- the IDs of values in this template- See Also:
-
Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.hasValueId(java.lang.String)
-
removeGeneratedValues
public final void removeGeneratedValues()Description copied from interface:TemplateReverts the generated values back to their default value.- Specified by:
removeGeneratedValuesin interfaceTemplate- See Also:
-
blankValue
Description copied from interface:TemplateSet the content of the specified value to an empty string.- Specified by:
blankValuein interfaceTemplate- Parameters:
id- the ID of a value in this template- See Also:
-
Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.hasValueId(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)
-
clear
public final void clear()Description copied from interface:TemplateResets all values in this template and removes any resource bundles. Configuration and localization tags are re-evaluated. -
getAvailableValueIds
Description copied from interface:TemplateReturns a list of the ID's of all values present in this template, including set and unset values.- Specified by:
getAvailableValueIdsin interfaceTemplate- Returns:
- a list of ID's of all set and unset value
-
getUnsetValueIds
Description copied from interface:TemplateReturns a collection of the ID's of all values in this template which have not been set.- Specified by:
getUnsetValueIdsin interfaceTemplate- Returns:
- a collection of ID's of values in this template which have not been set
-
hasValueId
Description copied from interface:TemplateReturns whether this template contains a value with the given ID.- Specified by:
hasValueIdin interfaceTemplate- Parameters:
id- the potential ID of a value in this template- Returns:
- whether this template contains a value with the given ID
- See Also:
-
Template.appendValue(java.lang.String, java.lang.Object)Template.appendValueEncoded(java.lang.String, java.lang.Object)Template.setValue(java.lang.String, java.util.List<java.lang.CharSequence>)Template.setValueEncoded(java.lang.String, java.lang.Object)Template.isValueSet(java.lang.String)Template.removeValue(java.lang.String)Template.removeValues(java.util.Collection<java.lang.String>)Template.blankValue(java.lang.String)Template.hasValueId(java.lang.String)
-
getModificationTime
public abstract long getModificationTime()Description copied from interface:TemplateReturns when the file corresponding to this template was modified, in milliseconds since the Unix epoch.- Specified by:
getModificationTimein interfaceTemplate- Returns:
- the time at which the underlying template file was modified
-
appendTextInternal
-
increasePartsCapacityInternal
-
increaseValuesCapacityInternal
-
appendBlockExternalForm
-
appendBlockInternalForm
-
potentiallyEvaluateRenderTag
-
appendValueExternalForm
-
appendDefaultValueExternalForm
-
appendValueInternalForm
-
appendDefaultValueInternalForm
-
createNewInstance
Description copied from interface:TemplateCreates a new template, using the same factory, name and encoding as those that were used to create this template instance.- Specified by:
createNewInstancein interfaceTemplate- Returns:
- a new template instance with the same parameters as this one
-
getFactoryIdentifier
Description copied from interface:TemplateReturns the unique identifier of the factory that was used to instantiate this template.- Specified by:
getFactoryIdentifierin interfaceTemplate- Returns:
- the unique identifier of this template's factory
-
getEncoding
Description copied from interface:TemplateReturns the encoding of this the content of this template.- Specified by:
getEncodingin interfaceTemplate- Returns:
- the encoding that was used when instantiating the template
-
getBeanHandler
Description copied from interface:TemplateReturns this template's bean handler. The bean handler is used for filling bean values into template values, and for building forms.- Specified by:
getBeanHandlerin interfaceTemplate- Returns:
- this template's bean handler
-
getFormBuilder
Description copied from interface:TemplateReturns this template's form builder. The form builder can be used for generating forms and fields.- Specified by:
getFormBuilderin interfaceTemplate- Returns:
- this template's form builder
-
getEncoder
Description copied from interface:TemplateReturns the encoder that this template uses to convert strings to values in the template's generated text output. In an HTML template, for example, this encoder may be used to convert text which may contain HTML special characters like<>to corresponding escaped strings.- Specified by:
getEncoderin interfaceTemplate- Returns:
- this template's encoder
-
addResourceBundles
Description copied from interface:TemplateAdds a list of resource bundles to this template. Resource bundles are used in many places, including when generating labels for forms, generating options for<select>tags, and using localized text.- Specified by:
addResourceBundlesin interfaceTemplate- Parameters:
resourceBundles- a list of resource bundle- See Also:
-
addResourceBundle
Description copied from interface:TemplateAdds a resource bundle to this template. Resource bundles are used in many places, including when generating labels for forms, generating options for<select>tags, and using localized text.- Specified by:
addResourceBundlein interfaceTemplate- Parameters:
resourceBundle- a resource bundle- See Also:
-
getResourceBundles
Description copied from interface:TemplateReturns a list of the resource bundles used by this template. This will contain any bundles added throughaddResourceBundleas well as any default resource bundles.- Specified by:
getResourceBundlesin interfaceTemplate- Returns:
- a list of this template's resource bundles
- See Also:
-
hasResourceBundles
public final boolean hasResourceBundles()Description copied from interface:TemplateReturns whether this template has any resource bundles registered.- Specified by:
hasResourceBundlesin interfaceTemplate- Returns:
- whether this template contains any resource bundles
- See Also:
-
setLanguage
Description copied from interface:TemplateSets this template's current language code, such as "en".This is used when
filling localized text values.- Specified by:
setLanguagein interfaceTemplate- Parameters:
lang- a 2-letter language code for the language to be used by this template- See Also:
-
getLanguage
Description copied from interface:TemplateReturns this template's current 2-letter language code. This code is used whenfilling localized text values. If the language has not been set, it defaults to the language set by the RIFE configuration parameter "L10N_DEFAULT_LANGUAGE".- Specified by:
getLanguagein interfaceTemplate- Returns:
- the 2-letter language code currently used by this template
- See Also:
-
setAttribute
Description copied from interface:TemplateSets an attribute that will be associated with this template instance.For general purpose attributes of object instances, it's recommended to use the fully qualified classname of the object as the attribute name.
- Specified by:
setAttributein interfaceTemplate- Parameters:
name- the name of the attributevalue- the value of the attribute- See Also:
-
setAttributes
Description copied from interface:TemplateSets the given attributes to the corresponding data. Calling this method is equivalent to callingsetAttributefor each entry in the given map.- Specified by:
setAttributesin interfaceTemplate- Parameters:
map- a map of attribute names and data- See Also:
-
removeAttribute
Description copied from interface:TemplateRemoves an attribute from this template instance.- Specified by:
removeAttributein interfaceTemplate- Parameters:
name- the name of the attribute- See Also:
-
hasAttribute
Description copied from interface:TemplateChecks whether an attribute exists in this template instance.- Specified by:
hasAttributein interfaceTemplate- Returns:
trueif the attribute exists;falseotherwise- See Also:
-
getAttribute
Description copied from interface:TemplateReturns the data of an attribute that was set in this template instance.- Specified by:
getAttributein interfaceTemplate- Returns:
- the attribute's data; or
nullof no such attribute could be found - See Also:
-
getAttributes
Description copied from interface:TemplateReturns the name and data of all attributes that have been set in this template instance.- Specified by:
getAttributesin interfaceTemplate- Returns:
- the attributes currently set in this template
- See Also:
-
getValueOrAttribute
Description copied from interface:TemplateReturns the content of a value or the data of an attribute with a particular name.If the value with the provided name has content, it will be returned. Otherwise, if an attribute with the provided name has data, the string presentation of that will be returned. If neither are present, and a default value was provided, that will be returned. Otherwise,
nullwill be returned.- Specified by:
getValueOrAttributein interfaceTemplate- Parameters:
name- the name of the value or attribute- Returns:
- the string presentation of the value or attribute with the provided name; or
nullif neither have data
-
getDefaultContentType
Description copied from interface:TemplateReturns this template's default content type, for exampletext/html.- Specified by:
getDefaultContentTypein interfaceTemplate- Returns:
- this template's default content type; or
nullif no default content type is known for this template instance
-
setDefaultContentType
-
isTemplateClassModified
-
clone
Description copied from interface:TemplateReturns a shallow copy of this template, with the same values.
-