Package org.httprpc.io
Class TemplateEncoder
- java.lang.Object
-
- org.httprpc.io.Encoder<java.lang.Object>
-
- org.httprpc.io.TemplateEncoder
-
public class TemplateEncoder extends Encoder<java.lang.Object>
Template encoder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTemplateEncoder.ModifierInterface 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.voidwrite(java.lang.Object value, java.io.OutputStream outputStream)Writes a value to an output stream.voidwrite(java.lang.Object value, java.io.OutputStream outputStream, java.util.Locale locale)Writes a value to an output stream.voidwrite(java.lang.Object value, java.io.OutputStream outputStream, java.util.Locale locale, java.util.TimeZone timeZone)Writes a value to an output stream.voidwrite(java.lang.Object value, java.io.Writer writer)Writes a value to a character stream.voidwrite(java.lang.Object value, java.io.Writer writer, java.util.Locale locale)Writes a value to a character stream.voidwrite(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 org.httprpc.io.Encoder
getCharset
-
-
-
-
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.IOExceptionDescription copied from class:EncoderWrites a value to an output stream.
-
write
public void write(java.lang.Object value, java.io.OutputStream outputStream, java.util.Locale locale) throws java.io.IOExceptionWrites 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.IOExceptionWrites 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.IOExceptionDescription copied from class:EncoderWrites a value to a character stream.
-
write
public void write(java.lang.Object value, java.io.Writer writer, java.util.Locale locale) throws java.io.IOExceptionWrites 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.IOExceptionWrites 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.
-
-