/** Sets (as xml) the "rate6" attribute */
 public void xsetRate6(org.apache.xmlbeans.XmlInteger rate6) {
   synchronized (monitor()) {
     check_orphaned();
     org.apache.xmlbeans.XmlInteger target = null;
     target = (org.apache.xmlbeans.XmlInteger) get_store().find_attribute_user(RATE6$10);
     if (target == null) {
       target = (org.apache.xmlbeans.XmlInteger) get_store().add_attribute_user(RATE6$10);
     }
     target.set(rate6);
   }
 }
 /** Sets (as xml) the "nr" attribute */
 public void xsetNr(org.apache.xmlbeans.XmlInteger nr) {
   synchronized (monitor()) {
     check_orphaned();
     org.apache.xmlbeans.XmlInteger target = null;
     target = (org.apache.xmlbeans.XmlInteger) get_store().find_attribute_user(NR$2);
     if (target == null) {
       target = (org.apache.xmlbeans.XmlInteger) get_store().add_attribute_user(NR$2);
     }
     target.set(nr);
   }
 }
 /** Sets (as xml) the "visinettportaler" attribute */
 public void xsetVisinettportaler(org.apache.xmlbeans.XmlInteger visinettportaler) {
   synchronized (monitor()) {
     check_orphaned();
     org.apache.xmlbeans.XmlInteger target = null;
     target =
         (org.apache.xmlbeans.XmlInteger) get_store().find_attribute_user(VISINETTPORTALER$4);
     if (target == null) {
       target =
           (org.apache.xmlbeans.XmlInteger) get_store().add_attribute_user(VISINETTPORTALER$4);
     }
     target.set(visinettportaler);
   }
 }
示例#4
0
 private int pickLength(SchemaType sType) {
   XmlInteger length = (XmlInteger) sType.getFacet(SchemaType.FACET_LENGTH);
   if (length != null) return length.getBigIntegerValue().intValue();
   XmlInteger min = (XmlInteger) sType.getFacet(SchemaType.FACET_MIN_LENGTH);
   XmlInteger max = (XmlInteger) sType.getFacet(SchemaType.FACET_MAX_LENGTH);
   int minInt, maxInt;
   if (min == null) minInt = 0;
   else minInt = min.getBigIntegerValue().intValue();
   if (max == null) maxInt = Integer.MAX_VALUE;
   else maxInt = max.getBigIntegerValue().intValue();
   // We try to keep the length of the array within reasonable limits,
   // at least 1 item and at most 3 if possible
   if (minInt == 0 && maxInt >= 1) minInt = 1;
   if (maxInt > minInt + 2) maxInt = minInt + 2;
   if (maxInt < minInt) maxInt = minInt;
   return minInt + pick(maxInt - minInt);
 }