Package com.caucho.jaxb.mapping

Examples of com.caucho.jaxb.mapping.XmlMapping


      }
      else {
        // process the attributes
        for (int i = 0; i < in.getAttributeCount(); i++) {
          QName attributeName = in.getAttributeName(i);
          XmlMapping mapping = getAttributeMapping(attributeName);

          if (mapping == null)
            throw new UnmarshalException(L.l("Attribute {0} not found in {1}",
                                             attributeName, getType()));

          mapping.readAttribute(in, i, ret);
        }

        int i = 0;
        in.nextTag();

        while (in.getEventType() == in.START_ELEMENT) {
          XmlMapping mapping = getElementMapping(in.getName());

          if (mapping == null) {
            throw new UnmarshalException(L.l("Child <{0}> not found in {1}",
                                             in.getName(), getType()));
          }

          if (! mapping.getAccessor().checkOrder(i++, u.getEventHandler())) {
            throw new UnmarshalException(L.l("Child <{0}> misordered in {1}",
                                             in.getName(), getType()));
          }

          mapping.read(u, in, ret);
        }

        // essentially a nextTag() that handles end of document gracefully
        while (in.hasNext()) {
          in.next();
View Full Code Here


      while (child != null) {
        if (child.getNodeType() == Node.ELEMENT_NODE) {
          QName name = JAXBUtil.qnameFromNode(child);

          XmlMapping mapping = getElementMapping(name);

          if (mapping == null)
            throw new UnmarshalException(L.l("Child <{0}> not found", name));

          if (! mapping.getAccessor().checkOrder(i++, binder.getEventHandler()))
            throw new UnmarshalException(L.l("Child <{0}> misordered", name));

          mapping.bindFrom(binder, node, ret);
        }

        child = node.nextSibling();
      }
    }
View Full Code Here

TOP

Related Classes of com.caucho.jaxb.mapping.XmlMapping

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.