Examples of SerializerRegistry


Examples of org.apache.muse.core.serializer.SerializerRegistry

     *
     */
    public static Element[] convertToElements(Object[] properties, Class type, QName qname)
        throws SoapFault
    {
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer ser = registry.getSerializer(type);       
        Element[] xml = new Element[properties.length];
       
        for (int n = 0; n < properties.length; ++n)
            xml[n] = ser.toXML(properties[n], qname);
       
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

     *
     */
    public static Object convertToObject(Element property, Class type)
        throws SoapFault
    {
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer deser = registry.getSerializer(type);
        return deser.fromXML(property);
    }
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

     *
     */
    public static Object convertToObjects(Element[] properties, Class type)
        throws SoapFault
    {
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer deser = registry.getSerializer(type);
       
        Object objects = Array.newInstance(type, properties.length);
       
        for (int n = 0; n < properties.length; ++n)
            Array.set(objects, n, deser.fromXML(properties[n]));
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

    if (elements.length != parameters.length)
    {
      throw new SoapFault("IncorrectParams");
    }

    SerializerRegistry registry = SerializerRegistry.getInstance();

    for (int i = 0; i < elements.length; ++i)
    {
      Class clazz = parameters[i];
      if (clazz == byte[].class)
      {
        objects[i] = new ByteArraySerializer().fromXML(elements[i]);
      } else
      {
        Serializer ser = registry.getSerializer(parameters[i]);
        objects[i] = ser.fromXML(elements[i]);
      }
    }
    return objects;
  }
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

       
        //
        // add NotificationMessage to the collection of serializable types in
        // case the user forgot to put it in muse.xml
        //
        SerializerRegistry registry = SerializerRegistry.getInstance();
        registry.registerSerializer(NotificationMessage.class, new NotificationMessageSerializer());
    }
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

            throw new NullPointerException(_MESSAGES.get("NullContentName"));

        if (content == null)
            throw new NullPointerException(_MESSAGES.get("NullMessageContent"));
       
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer ser = registry.getSerializer(content.getClass());
        Element xml = ser.toXML(content, qname);
       
        _messageContent.put(qname, xml);
    }
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

    public Object getMessageContent(QName qname, Class type)
        throws SoapFault
    {
        Element content = getMessageContent(qname);
       
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer ser = registry.getSerializer(type);
       
        return ser.fromXML(content);
    }
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

    public static Element[] convertToElements(Object[] properties,
                                              Class type,
                                              QName qname)
        throws SoapFault
    {
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer ser = registry.getSerializer(type);       
        Element[] xml = new Element[properties.length];
       
        for (int n = 0; n < properties.length; ++n)
            xml[n] = ser.toXML(properties[n], qname);
       
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

     *
     */
    public static Object convertToObjects(Element[] properties, Class type)
        throws BaseFault
    {
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer deser = registry.getSerializer(type);
       
        Object objects = Array.newInstance(type, properties.length);
       
        try
        {
View Full Code Here

Examples of org.apache.muse.core.serializer.SerializerRegistry

                method.getName(), new Integer(parameters.length), new Integer(elements.length)       
            };
            throw new SoapFault(_MESSAGES.get("IncorrectParams", filler));
        }

        SerializerRegistry registry = SerializerRegistry.getInstance();
       
        //
        // general case: apply appropriate serializer to each child element
        //
        for (int i = 0; i < elements.length; ++i)
        {
            Serializer ser = registry.getSerializer(parameters[i]);
            objects[i] = ser.fromXML(elements[i]);
        }
       
        return objects;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.