private Object deserializeValue(Serializer ser, Element value) throws BaseFault { try { return ser.fromXML(value); } catch (SoapFault error) { throw WsbfUtils.convertToFault(error); } }
public Object[] fromXML(Element xml) throws SoapFault { // // use the Muse serializer framework to convert <Notify/> into // an array of NotificationMessage objects // SerializerRegistry registry = SerializerRegistry.getInstance(); Serializer ser = registry.getSerializer(NotificationMessage[].class); Object messageArray = ser.fromXML(xml); return new Object[]{ messageArray }; }
Array.set(objects, n, deser.fromXML(properties[n]));
/** * * Deserializes the given DOM Element using the Serializer registered * for the given type. * * @param xml * @param theClass * * @return An instance of the given type, created from the given XML. If * the type is null (or void), the method returns null. * * @throws SoapFault * <ul> * <li>If the XML cannot be deserialized to the given type.</li> * </ul> * */ protected Object deserialize(Element xml, Class theClass) throws SoapFault { if (theClass == null || theClass == Void.TYPE) return null; SerializerRegistry registry = SerializerRegistry.getInstance(); Serializer deser = registry.getSerializer(theClass); return deser.fromXML(xml); }
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); }
/** * * Uses one of Muse's registered Serializers to convert the given Element * into an instance of the given type. * * @param property * The property value to deserialize. * * @param type * The type whose registered Serializer will be used to parse * the property value. * * @return The POJO representation of the given property value. * * @throws SoapFault * <ul> * <li>If the value could not be deserialized.</li> * </ul> * */ public static Object convertToObject(Element property, Class type) throws SoapFault { SerializerRegistry registry = SerializerRegistry.getInstance(); Serializer deser = registry.getSerializer(type); return deser.fromXML(property); }
Object result = serializer.fromXML(children[n]); Array.set(array, n, result);
objects[i] = ser.fromXML(elements[i]);