View Javadoc

    1   package org.codehaus.xfire.aegis;
    2
    3   /***
    4    * Basic type conversion functionality for writing messages.
    5    *
    6    * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
    7    */
    8   public abstract class AbstractMessageWriter
    9           implements MessageWriter
    10  {
    11      /***
    12       * Create a LiteralWriter but without writing an element name.
    13       *
    14       * @param writer
    15       */
    16      public AbstractMessageWriter()
    17      {
    18      }
    19
    20      /***
    21       * @see org.codehaus.xfire.aegis.MessageWriter#writeValueAsInt(java.lang.Integer)
    22       */
    23      public void writeValueAsInt(Integer i)
    24      {
    25          writeValue(i.toString());
    26      }
    27
    28      /***
    29       * @see org.codehaus.xfire.aegis.MessageWriter#writeValueAsDouble(java.lang.Double)
    30       */
    31      public void writeValueAsDouble(Double d)
    32      {
    33          writeValue(d.toString());
    34      }
    35
    36      /***
    37       * @see org.codehaus.xfire.aegis.MessageWriter#writeValueAsLong(java.lang.Long)
    38       */
    39      public void writeValueAsLong(Long l)
    40      {
    41          writeValue(l.toString());
    42      }
    43
    44      /***
    45       * @see org.codehaus.xfire.aegis.MessageWriter#writeValueAsFloat(java.lang.Float)
    46       */
    47      public void writeValueAsFloat(Float f)
    48      {
    49          writeValue(f.toString());
    50      }
    51
    52      /***
    53       * @see org.codehaus.xfire.aegis.MessageWriter#writeValueAsBoolean(boolean)
    54       */
    55      public void writeValueAsBoolean(boolean b)
    56      {
    57          writeValue(b ? "true" : "false");
    58      }
    59  }