Package com.caucho.jaxb.property

Examples of com.caucho.jaxb.property.Property


      while (reader.getEventType() != XMLStreamReader.START_ELEMENT)
        reader.next();

      QName name = reader.getName();

      Property property = _context.createProperty(declaredType);

      T val = (T) property.read(this, reader, null);

      return new JAXBElement<T>(name, declaredType, val);
    }
    catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here


    for (int i = 0; i < skeletons.size(); i++) {
      ClassSkeleton skeleton = skeletons.get(i);
      map.put(skeleton.getElementName(), this);

      QName qname = skeleton.getElementName();
      Property property = _context.createProperty(skeleton.getType());

      qnameToPropertyMap.put(qname, property);
      classToPropertyMap.put(skeleton.getType(), property);
    }
View Full Code Here

    for (XmlElement element : elements.value()) {
      if (XmlElement.DEFAULT.class.equals(element.type()))
        throw new JAXBException(L.l("@XmlElement annotations in @XmlElements must specify a type"));

      QName qname = qnameFromXmlElement(element);
      Property property = _context.createProperty(element.type());

      qnameToPropertyMap.put(qname, property);
      classToPropertyMap.put(element.type(), property);
      _qnameMap.put(element.type(), qname);

      if (! property.isXmlPrimitiveType())
        _context.createSkeleton(element.type());
    }

    _property = new MultiProperty(qnameToPropertyMap, classToPropertyMap);
View Full Code Here

    throws IOException, XMLStreamException, JAXBException
  {
    ClassSkeleton skeleton = _context.findSkeletonForObject(obj);

    if (skeleton == null) {
      Property property = _context.getSimpleTypeProperty(obj.getClass());

      if (property == null)
        throw new JAXBException(L.l("Unknown class {0}", obj.getClass()));

      property.write(m, out, obj, namer); // XXX attributes
    }
    else
      skeleton.write(m, out, obj, null, attributes);
  }
View Full Code Here

    if (type != null) {
      QName typeQName = StaxUtil.resolveStringToQName(type, in);
      Class cl = JAXBUtil.getClassForDatatype(typeQName);
     
      Property property = _context.createProperty(cl);

      return property.read(u, in, null);
    }
    else {
      DOMResult result = new DOMResult();
      XMLOutputFactory factory = _context.getXMLOutputFactory();
      XMLStreamWriter out = factory.createXMLStreamWriter(result);
View Full Code Here

        skeleton.write(m, out, obj, null, attributes);
        return;
      }

      Property property = _context.getSimpleTypeProperty(obj.getClass());

      if (property != null) {
        XmlInstanceWrapper instanceWrapper =
          XmlInstanceWrapper.getInstance(property.getSchemaType());

        if (attributes == null)
          attributes = new ArrayList<XmlMapping>(1);

        attributes.add(instanceWrapper);

        // XXX the second obj here is a hack: we just need it not to be null.
        // Figure out if the api is wrong or there is a reasonable value for
        // the fifth argument instead of this second obj.
        property.write(m, out, obj, namer, obj, attributes);
        return;
      }

      if (obj instanceof Node) {
        XMLInputFactory factory = _context.getXMLInputFactory();
View Full Code Here

TOP

Related Classes of com.caucho.jaxb.property.Property

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.