Package org.apache.muse.core.serializer

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


                                              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);
       
        return xml;
    }
View Full Code Here


     */
    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
        {
            for (int n = 0; n < properties.length; ++n)
                Array.set(objects, n, deser.fromXML(properties[n]));
        }
       
        catch (SoapFault fault)
        {
            throw new SerializationErrorFault(fault);
View Full Code Here

    {
        if (theClass == null || theClass == Void.TYPE)
            return null;
       
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer deser = registry.getSerializer(theClass);
        return deser.fromXML(xml);
    }
View Full Code Here

        return XmlUtils.createElement(qname);
     
        Class theClass = obj.getClass();
       
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer ser = registry.getSerializer(theClass);
       
        Element xml = ser.toXML(obj, qname);
       
        //
        // HACK: Workaround to reuse serializers intended for MessageHandlers
        //
        //       Instances of the Serializer interface are written so that
View Full Code Here

        //
        // 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

        // for all non-void methods, we need to find the serializer
        // for the return type, then determine if it's an array and
        // deal with it accordingly
        //
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer ser = registry.getSerializer(returnType);
       
        QName returnValueName = getReturnValueName();
        QName responseBodyName = getResponseName();
        boolean isComplex = true;
       
        //
        // for many simple return types, we just embed the value in
        // the body's response element
        //
        if (returnValueName == null)
        {
            isComplex = false;
            returnValueName = responseBodyName;
        }
       
        //
        // for complex types, we need a child element under the
        // response body element
        //
        Element responseXML = XmlUtils.createElement(responseBodyName);
        Element valueXML = ser.toXML(result, returnValueName);
       
        //
        // for arrays, we put the children (array items) under the
        // response body element
        //
View Full Code Here

           
            while (i.hasNext())
            {
                SerializerDefinition next = (SerializerDefinition)i.next();
               
                Serializer ser = next.create();
                Class type = ser.getSerializableType();
               
                Class arrayType = ReflectUtils.getArrayClassFromClass(type);
                Serializer arraySer = new ArraySerializer(arrayType, ser);
               
                registry.registerSerializer(type, ser);
                registry.registerSerializer(arrayType, arraySer);
            }
           
View Full Code Here

        }
       
        Element[] properties = new Element[values.length];
       
        SerializerRegistry registry = SerializerRegistry.getInstance();
        Serializer ser = registry.getSerializer(type);
       
        for (int n = 0; n < values.length; ++n)
            properties[n] = serializeValue(ser, values[n], name);
       
        return properties;
View Full Code Here

        SerializerRegistry registry = SerializerRegistry.getInstance();
       
        if (isArray)
        {
            Class theClass = ReflectUtils.getClassFromArrayClass(paramTypes[0]);
            Serializer ser = registry.getSerializer(theClass);
           
            params[0] = Array.newInstance(theClass, values.length);
           
            for (int n = 0; n < values.length; ++n)
                Array.set(params[0], n, deserializeValue(ser, values[n]));
        }
       
        else
        {
            Serializer ser = registry.getSerializer(paramTypes[0]);
            params[0] = deserializeValue(ser, values[0]);
        }
       
        invokeMethod(method, params);
    }
View Full Code Here

      SerializerRegistry registry = SerializerRegistry.getInstance();

      while (i.hasNext()) {
        SerializerDefinition next = (SerializerDefinition) i.next();

        Serializer ser = next.create();
        Class type = ser.getSerializableType();

        Class arrayType = ReflectUtils.getArrayClassFromClass(type);
        Serializer arraySer = new ArraySerializer(arrayType, ser);

        registry.registerSerializer(type, ser);
        registry.registerSerializer(arrayType, arraySer);
      }
View Full Code Here

TOP

Related Classes of org.apache.muse.core.serializer.Serializer

Copyright © 2018 www.massapicom. 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.