Class TemplateEncoder


  • public class TemplateEncoder
    extends Encoder<java.lang.Object>
    Template encoder.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  TemplateEncoder.Modifier
      Interface representing a modifier.
    • Constructor Summary

      Constructors 
      Constructor Description
      TemplateEncoder​(java.net.URL url)
      Constructs a new template encoder.
      TemplateEncoder​(java.net.URL url, java.nio.charset.Charset charset)
      Constructs a new template encoder.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​TemplateEncoder.Modifier> getDefaultModifiers()
      Returns the default modifier map.
      java.util.Map<java.lang.String,​TemplateEncoder.Modifier> getModifiers()
      Returns the modifier map.
      void write​(java.lang.Object value, java.io.OutputStream outputStream)
      Writes a value to an output stream.
      void write​(java.lang.Object value, java.io.OutputStream outputStream, java.util.Locale locale)
      Writes a value to an output stream.
      void write​(java.lang.Object value, java.io.OutputStream outputStream, java.util.Locale locale, java.util.TimeZone timeZone)
      Writes a value to an output stream.
      void write​(java.lang.Object value, java.io.Writer writer)
      Writes a value to a character stream.
      void write​(java.lang.Object value, java.io.Writer writer, java.util.Locale locale)
      Writes a value to a character stream.
      void write​(java.lang.Object value, java.io.Writer writer, java.util.Locale locale, java.util.TimeZone timeZone)
      Writes a value to a character stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TemplateEncoder

        public TemplateEncoder​(java.net.URL url)
        Constructs a new template encoder.
        Parameters:
        url - The URL of the template.
      • TemplateEncoder

        public TemplateEncoder​(java.net.URL url,
                               java.nio.charset.Charset charset)
        Constructs a new template encoder.
        Parameters:
        url - The URL of the template.
        charset - The character encoding used by the template.
    • Method Detail

      • getModifiers

        public java.util.Map<java.lang.String,​TemplateEncoder.Modifier> getModifiers()
        Returns the modifier map.
        Returns:
        The modifier map.
      • write

        public void write​(java.lang.Object value,
                          java.io.OutputStream outputStream)
                   throws java.io.IOException
        Description copied from class: Encoder
        Writes a value to an output stream.
        Overrides:
        write in class Encoder<java.lang.Object>
        Parameters:
        value - The value to encode.
        outputStream - The output stream to write to.
        Throws:
        java.io.IOException - If an exception occurs.
      • write

        public void write​(java.lang.Object value,
                          java.io.OutputStream outputStream,
                          java.util.Locale locale)
                   throws java.io.IOException
        Writes a value to an output stream.
        Parameters:
        value - The value to encode.
        outputStream - The output stream to write to.
        locale - The locale to use when writing the value.
        Throws:
        java.io.IOException - If an exception occurs.
      • write

        public void write​(java.lang.Object value,
                          java.io.OutputStream outputStream,
                          java.util.Locale locale,
                          java.util.TimeZone timeZone)
                   throws java.io.IOException
        Writes a value to an output stream.
        Parameters:
        value - The value to encode.
        outputStream - The output stream to write to.
        locale - The locale to use when writing the value.
        timeZone - The time zone to use when writing the value.
        Throws:
        java.io.IOException - If an exception occurs.
      • write

        public void write​(java.lang.Object value,
                          java.io.Writer writer)
                   throws java.io.IOException
        Description copied from class: Encoder
        Writes a value to a character stream.
        Specified by:
        write in class Encoder<java.lang.Object>
        Parameters:
        value - The value to encode.
        writer - The character stream to write to.
        Throws:
        java.io.IOException - If an exception occurs.
      • write

        public void write​(java.lang.Object value,
                          java.io.Writer writer,
                          java.util.Locale locale)
                   throws java.io.IOException
        Writes a value to a character stream.
        Parameters:
        value - The value to encode.
        writer - The character stream to write to.
        locale - The locale to use when writing the value.
        Throws:
        java.io.IOException - If an exception occurs.
      • write

        public void write​(java.lang.Object value,
                          java.io.Writer writer,
                          java.util.Locale locale,
                          java.util.TimeZone timeZone)
                   throws java.io.IOException
        Writes a value to a character stream.
        Parameters:
        value - The value to encode.
        writer - The character stream to write to.
        locale - The locale to use when writing the value.
        timeZone - The time zone to use when writing the value.
        Throws:
        java.io.IOException - If an exception occurs.
      • getDefaultModifiers

        public static java.util.Map<java.lang.String,​TemplateEncoder.Modifier> getDefaultModifiers()
        Returns the default modifier map.
        Returns:
        The default modifier map.