Examples of nillable()


Examples of com.sun.xml.bind.v2.schemagen.xmlschema.LocalElement.nillable()

                if (ename != null) { // wrapped collection
                    LocalElement e = compositor.element();
                    ComplexType p = e.name(ename.getLocalPart()).complexType();
                    elementFormDefault.writeForm(e,ename);
                    if(rp.isCollectionNillable())
                        e.nillable(true);
                    if (rp.getElements().size() == 1) {
                        compositor = p.sequence();
                    } else {
                        compositor = p.choice();
                        occurs = compositor;
View Full Code Here

Examples of com.sun.xml.bind.v2.schemagen.xmlschema.LocalElement.nillable()

            QName ename = mp.getXmlName();

            LocalElement e = compositor.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);
            ComplexType p = e.name(ename.getLocalPart()).complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
View Full Code Here

Examples of com.sun.xml.bind.v2.schemagen.xmlschema.TopLevelElement.nillable()

            }

            public void writeTo(String localName, Schema schema) {
                TopLevelElement e = schema.element().name(localName);
                if(nillable)
                    e.nillable(true);
                if (type != null) {
                    writeTypeRef(e,type, "type");
                } else {
                    e.complexType();    // refer to the nested empty complex type
                }
View Full Code Here

Examples of com.sun.xml.internal.bind.v2.schemagen.xmlschema.LocalElement.nillable()

            ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
            ct._final("#all");
            LocalElement le = ct.sequence().element().name("item");
            le.type(a.getItemType().getTypeName());
            le.minOccurs(0).maxOccurs("unbounded");
            le.nillable(true);
            ct.commit();
        }

        /**
         * writes the schema definition for the specified type-safe enum in the given TypeHost
View Full Code Here

Examples of com.sun.xml.internal.bind.v2.schemagen.xmlschema.TopLevelElement.nillable()

            }

            public void writeTo(String localName, Schema schema) {
                TopLevelElement e = schema.element().name(localName);
                if(nillable)
                    e.nillable(true);
                if(type!=null) {
                    writeTypeRef(e,type, "type");
                } else {
                    e.complexType();    // refer to the nested empty complex type
                }
View Full Code Here

Examples of javax.xml.bind.annotation.XmlElement.nillable()

                           Field declaredField = getDeclaredField(clazz,name);
                           XmlElement   xmlElm   =  declaredField.getAnnotation(XmlElement.class);
                             if(xmlElm != null){
                               if(!xmlElm.defaultValue().equals(NULL) && isJSONPrimitive(propertyType)){
                                 value = xmlElm.defaultValue();
                               } else if(!xmlElm.nillable() && createDefaultOnNonNullable){
                                 if(!isJSONPrimitive(propertyType)){
                                   if(!stackNillableInstances.contains(propertyType)){
                                     stackNillableInstances.push(propertyType);
                                     value = getNewInstance(propertyType);
                                     hasData = this.add(name, value, null, hasData, property) || hasData;
View Full Code Here

Examples of javax.xml.bind.annotation.XmlElement.nillable()

                traceLog.info(String.format("Input do not have %s. Populating default value: %s. flag to populate: %b",
                    expectedJSONPropName, element.defaultValue(), createDefaultOnNonNullable));
              writeMethod.invoke(object,
                  convert(propertyType, f.getType(), element.defaultValue(),
                      writeMethodConfig, writeMethod));
            } else if (!element.nillable() && createDefaultOnNonNullable) {
              // there is no default value and non nullable.
              if(!isJSONPrimitive(propertyType)){
                if(traceEnabled)
                  traceLog.warn("Non nillable object(\""+expectedJSONPropName +
                    "\") with nill value, populating default.");
View Full Code Here

Examples of javax.xml.bind.annotation.XmlElement.nillable()

                    assert el != null;
                }
            }
           
            if (part == null) {
                if (!el.nillable()) {
                    throw new IllegalArgumentException("null value for field not permitted.");
                }
                return;
            }
View Full Code Here

Examples of javax.xml.bind.annotation.XmlElement.nillable()

    _property = _context.createProperty(accessor.getGenericType(), false,
                                        mimeType, xmlList);

    if (element != null) {
      _qname = qnameFromXmlElement(element);
      _nillable = element.nillable();
    }
    else {
      XmlSchema xmlSchema = accessor.getPackageAnnotation(XmlSchema.class);

      if (xmlSchema != null &&
View Full Code Here

Examples of javax.xml.bind.annotation.XmlElement.nillable()

          if (element.required())
            out.writeAttribute("minOccurs", "1");
          else
            out.writeAttribute("minOccurs", "0");

          if (element.nillable())
            out.writeAttribute("nillable", "true");
        }
        else
          out.writeAttribute("minOccurs", "0");
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.