Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlInteger


          ResourceContextException
   {
      PrinterPortResource printerResource      = (PrinterPortResource) getResourceContext(  ).getResource(  );
      ResourceProperty    printerJobProperties =
         printerResource.getResourcePropertySet(  ).get( PrinterPortPropertyQNames.QUEUED_JOB_COUNT );
      XmlInteger          queued               = (XmlInteger) printerJobProperties.get( 0 );
      BigInteger          bigIntegerValue      = queued.getBigIntegerValue(  );
      int                 count                = bigIntegerValue.intValue(  );
      count++;
      queued.setBigIntegerValue( BigInteger.valueOf( count ) );
   }
View Full Code Here


        Body body = envelopeDocument.getEnvelope().getBody();
        XmlObject[] childElements = XmlBeanUtils.getChildElements(body, new QName("http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd","GetResourcePropertyDocumentResponse"));
        XmlObject childElement = childElements[0];
        XmlObject[] printerprops = XmlBeanUtils.getChildElements(childElement, new QName(PrinterPortPropertyQNames.QUEUED_JOB_COUNT.getNamespaceURI(), "printer_properties"));
        XmlInteger elem = (XmlInteger) XmlBeanUtils.getChildElements(printerprops[0], PrinterPortPropertyQNames.QUEUED_JOB_COUNT)[0];
        assertTrue(elem.getBigIntegerValue().intValue() == 0);
        XmlBoolean bool = (XmlBoolean) XmlBeanUtils.getChildElements(printerprops[0], PrinterPortPropertyQNames.PRINTER_IS_ACCEPTING_JOBS)[0];
        assertTrue(bool.getBooleanValue() == false);
    }
View Full Code Here

                    //set termination time to now to make it be removed.
                    job.setTerminationTime(Calendar.getInstance());

                    XmlBeansResourcePropertySet jobPropSet = (XmlBeansResourcePropertySet) job.getResourcePropertySet();
                    ResourceProperty resourceProperty = jobPropSet.get(JobPortPropertyQNames.JOB_ID);
                    XmlInteger jobint = (XmlInteger) resourceProperty.get(0);
                    BigInteger bigIntegerValue = jobint.getBigIntegerValue();                   

                    decrementQueueCount();
                    setJobState(job, JobStateType.COMPLETED);
                }
            }
View Full Code Here

    }

    private void decrementQueueCount()
    {
        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(PrinterPortPropertyQNames.QUEUED_JOB_COUNT);
        XmlInteger count = (XmlInteger) resourceProperty.get(0);
        int intCount = count.getBigIntegerValue().intValue();
        --intCount;
        count.setBigIntegerValue(BigInteger.valueOf(intCount));
    }
View Full Code Here

                            myFacets[SchemaType.FACET_MAX_LENGTH] != null)
                        {
                            state.error("Cannot specify length in addition to minLength or maxLength", XmlErrorContext.FACET_DUPLICATED, facet);
                            continue;
                        }
                        XmlInteger len = StscTranslator.buildNnInteger(facet.getValue());
                        if (len == null)
                        {
                            state.error("Must be a nonnegative integer", XmlErrorContext.FACET_VALUE_MALFORMED, facet);
                            continue;
                        }
                        if (fixedFacets[code] && !myFacets[code].valueEquals(len))
                        {
                            state.error("This facet is fixed and cannot be overridden", XmlErrorContext.FACET_FIXED, facet);
                            continue;
                        }
                        myFacets[code] = len;
                        break;

                    case SchemaType.FACET_MIN_LENGTH:
                    case SchemaType.FACET_MAX_LENGTH:
                        if (myFacets[SchemaType.FACET_LENGTH] != null)
                        {
                            state.error("Cannot specify minLength or maxLength in addition to length", XmlErrorContext.FACET_DUPLICATED, facet);
                            continue;
                        }
                        XmlInteger mlen = StscTranslator.buildNnInteger(facet.getValue());
                        if (mlen == null)
                        {
                            state.error("Must be a nonnegative integer", XmlErrorContext.FACET_VALUE_MALFORMED, facet);
                            continue;
                        }
                        if (fixedFacets[code] && !myFacets[code].valueEquals(mlen))
                        {
                            state.error("This facet is fixed and cannot be overridden", XmlErrorContext.FACET_FIXED, facet);
                            continue;
                        }
                        if (myFacets[SchemaType.FACET_MAX_LENGTH] != null)
                        {
                            if (mlen.compareValue(myFacets[SchemaType.FACET_MAX_LENGTH]) > 0)
                            {
                                state.error("Larger than prior maxLength", XmlErrorContext.FACET_VALUE_MALFORMED, facet);
                                continue;
                            }
                        }
                        if (myFacets[SchemaType.FACET_MIN_LENGTH] != null)
                        {
                            if (mlen.compareValue(myFacets[SchemaType.FACET_MIN_LENGTH]) < 0)
                            {
                                state.error("Smaller than prior minLength", XmlErrorContext.FACET_VALUE_MALFORMED, facet);
                                continue;
                            }
                        }
                        myFacets[code] = mlen;
                        break;

                    case SchemaType.FACET_TOTAL_DIGITS:
                    case SchemaType.FACET_FRACTION_DIGITS:
                        boolean istotaldig = (code == SchemaType.FACET_TOTAL_DIGITS);
                        XmlInteger dig = StscTranslator.buildNnInteger(facet.getValue());
                        if (dig == null)
                        {
                            state.error("Must be a nonnegative integer", XmlErrorContext.FACET_VALUE_MALFORMED, facet);
                            break;
                        }
                        if (fixedFacets[code] && !myFacets[code].valueEquals(dig))
                        {
                            state.error("This facet is fixed and cannot be overridden", XmlErrorContext.FACET_FIXED, facet);
                            continue;
                        }
                        if (myFacets[SchemaType.FACET_TOTAL_DIGITS] != null)
                        {
                            if (dig.compareValue(myFacets[SchemaType.FACET_TOTAL_DIGITS]) > 0)
                                state.error("Larger than prior totalDigits", XmlErrorContext.FACET_VALUE_MALFORMED, facet);
                        }
                        if (!istotaldig && myFacets[SchemaType.FACET_FRACTION_DIGITS] != null)
                        {
                            if (dig.compareValue(myFacets[SchemaType.FACET_FRACTION_DIGITS]) > 0)
                                state.error("Larger than prior fractionDigits", XmlErrorContext.FACET_VALUE_MALFORMED, facet);
                        }
                        myFacets[code] = dig;
                        break;
View Full Code Here

    return sb.toString();
  }

  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 )
View Full Code Here

          ResourceContextException
   {
      PrinterPortResource printerResource      = (PrinterPortResource) getResourceContext(  ).getResource(  );
      ResourceProperty    printerJobProperties =
         printerResource.getResourcePropertySet(  ).get( PrinterPortPropertyQNames.QUEUED_JOB_COUNT );
      XmlInteger          queued               = (XmlInteger) printerJobProperties.get( 0 );
      BigInteger          bigIntegerValue      = queued.getBigIntegerValue(  );
      int                 count                = bigIntegerValue.intValue(  );
      count++;
      queued.setBigIntegerValue( BigInteger.valueOf( count ) );
   }
View Full Code Here

                    //set termination time to now to make it be removed.
                    job.setTerminationTime(Calendar.getInstance());

                    XmlBeansResourcePropertySet jobPropSet = (XmlBeansResourcePropertySet) job.getResourcePropertySet();
                    ResourceProperty resourceProperty = jobPropSet.get(JobPortPropertyQNames.JOB_ID);
                    XmlInteger jobint = (XmlInteger) resourceProperty.get(0);
                    BigInteger bigIntegerValue = jobint.getBigIntegerValue();                   

                    decrementQueueCount();
                    setJobState(job, JobStateType.COMPLETED);
                }
            }
View Full Code Here

    }

    private void decrementQueueCount()
    {
        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(PrinterPortPropertyQNames.QUEUED_JOB_COUNT);
        XmlInteger count = (XmlInteger) resourceProperty.get(0);
        int intCount = count.getBigIntegerValue().intValue();
        --intCount;
        count.setBigIntegerValue(BigInteger.valueOf(intCount));
    }
View Full Code Here

                            myFacets[SchemaType.FACET_MAX_LENGTH] != null)
                        {
                            state.error(XmlErrorCodes.DATATYPE_LENGTH, null, facet);
                            continue;
                        }
                        XmlInteger len = StscTranslator.buildNnInteger(facet.getValue());
                        if (len == null)
                        {
                            state.error("Must be a nonnegative integer", XmlErrorCodes.FACET_VALUE_MALFORMED, facet);
                            continue;
                        }
                        if (fixedFacets[code] && !myFacets[code].valueEquals(len))
                        {
                            state.error(XmlErrorCodes.FACET_FIXED, new Object[] { facetName }, facet);
                            continue;
                        }
                        myFacets[code] = len;
                        break;

                    case SchemaType.FACET_MIN_LENGTH:
                    case SchemaType.FACET_MAX_LENGTH:
                        if (myFacets[SchemaType.FACET_LENGTH] != null)
                        {
                            state.error(XmlErrorCodes.DATATYPE_LENGTH, null, facet);
                            continue;
                        }
                        XmlInteger mlen = StscTranslator.buildNnInteger(facet.getValue());
                        if (mlen == null)
                        {
                            state.error("Must be a nonnegative integer", XmlErrorCodes.FACET_VALUE_MALFORMED, facet);
                            continue;
                        }
                        if (fixedFacets[code] && !myFacets[code].valueEquals(mlen))
                        {
                            state.error(XmlErrorCodes.FACET_FIXED, new Object[] { facetName }, facet);
                            continue;
                        }
                        if (myFacets[SchemaType.FACET_MAX_LENGTH] != null)
                        {
                            if (mlen.compareValue(myFacets[SchemaType.FACET_MAX_LENGTH]) > 0)
                            {
                                state.error(XmlErrorCodes.DATATYPE_MAX_LENGTH_RESTRICTION, null, facet);
                                continue;
                            }
                        }
                        if (myFacets[SchemaType.FACET_MIN_LENGTH] != null)
                        {
                            if (mlen.compareValue(myFacets[SchemaType.FACET_MIN_LENGTH]) < 0)
                            {
                                state.error(XmlErrorCodes.DATATYPE_MIN_LENGTH_RESTRICTION, null, facet);
                                continue;
                            }
                        }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlInteger

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.