Ejemplo n.º 1
0
  public void marshal(Object arg0, IMarshallingContext arg1) throws JiBXException {

    if (arg0 instanceof Float) {

      MarshallingContext ctx = (MarshallingContext) arg1;

      ctx.startTagAttributes(m_index, m_name).attribute(m_index, TYPE, FLOAT).closeStartContent();
      ctx.content(((Float) arg0).toString());

      /*
       * ctx.startTagAttributes(m_index, "FLOAT"); ctx.attribute(m_index,
       * "CHAVE", ((Float)arg0).toString()); ctx.closeStartContent(); //
       */
      ctx.endTag(m_index, m_name);
    } else if (arg0 instanceof Colorf) {
      MarshallingContext ctx = (MarshallingContext) arg1;

      ctx.startTagAttributes(m_index, m_name).attribute(m_index, TYPE, COLOR).closeStartContent();
      ctx.content(colorConverter.toString(arg0));

      ctx.endTag(m_index, m_name);
    } else if (arg0 instanceof Vector3f) {
      MarshallingContext ctx = (MarshallingContext) arg1;

      ctx.startTagAttributes(m_index, m_name).attribute(m_index, TYPE, VECTOR).closeStartContent();
      ctx.content(vectorConverter.toString(arg0));

      ctx.endTag(m_index, m_name);
    } else if (arg0 instanceof Point3f) {
      MarshallingContext ctx = (MarshallingContext) arg1;

      ctx.startTagAttributes(m_index, m_name).attribute(m_index, TYPE, POINT).closeStartContent();
      ctx.content(pointConverter.toString(arg0));

      ctx.endTag(m_index, m_name);
    }
  }