コード例 #1
0
    public SOAPHandler onStartChild(
        String namespace,
        String localName,
        String prefix,
        Attributes attributes,
        DeserializationContext context)
        throws SAXException {
      QName typeQName = context.getTypeFromAttributes(namespace, localName, attributes);
      Deserializer dser = context.getDeserializerForType(typeQName);

      if (dser == null) dser = new DeserializerImpl();

      SOAPConstants soapConstants = context.getSOAPConstants();
      String href = attributes.getValue(soapConstants.getAttrHref());

      if (href != null) {
        Object ref = context.getObjectByRef(href);

        ItemHandler handler = new ItemHandler(md);

        addChildDeserializer(handler);

        return handler;
      }

      addChildDeserializer(dser);
      return (SOAPHandler) dser;
    }
コード例 #2
0
    public SOAPHandler onStartChild(
        String namespace,
        String localName,
        String prefix,
        Attributes attributes,
        DeserializationContext context)
        throws SAXException {
      QName typeQName = context.getTypeFromAttributes(namespace, localName, attributes);
      Deserializer dser = context.getDeserializerForType(typeQName);

      // If no deserializer, use the base DeserializerImpl.
      if (dser == null) dser = new DeserializerImpl();

      // When the child value is ready, we
      // want our set method to be invoked.
      // To do this register a DeserializeTarget on the
      // new Deserializer.
      DeserializerTarget dt = null;
      if (context.isNil(attributes)) {
        dt = new DeserializerTarget(this, NILHINT);
      } else if (localName.equals("key")) {
        dt = new DeserializerTarget(this, KEYHINT);
      } else if (localName.equals("value")) {
        dt = new DeserializerTarget(this, VALHINT);
      } else {
        // Do nothing
      }
      if (dt != null) {
        dser.registerValueTarget(dt);
      }

      // We need this guy to complete for us to complete.
      addChildDeserializer(dser);

      return (SOAPHandler) dser;
    }