Examples of ErrorBag


Examples of org.xooof.xmlstruct.ErrorBag

            new org.xooof.xmlstruct.test.nons.PackageXmlStructFactory(),
            new org.xooof.xmlstruct.test.ns1.PackageXmlStructFactory(),
            new org.xooof.xmlstruct.test.ns2.PackageXmlStructFactory(),
            });
        XmlStruct xs = null;
        ErrorBag eb = new ErrorBag();
           

        FileWriter rw = new FileWriter(result);
        SAXTransformerFactory tf = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
        TransformerHandler handler = tf.newTransformerHandler();
        handler.setResult(new StreamResult(rw));
        try
        {
            handler.startDocument();
            startElement(handler,"result");
           
            // xsFromXML
            try
            {
                FileInputStream fis = new FileInputStream(source);
                xs = XmlStructUtils.xsFromXML(sf,fis,eb,"");
                if (eb.size() > 0)
                {
                    writeElementString(handler,"fromXmlErr",eb.toString());
                    return;
                }
                else
                {
                    writeElementString(handler,"fromXmlOk","");
                }
            }
            catch(XmlStructException e)
            {
                writeElementString(handler,"fromXmlErr",e.getMessage());
                return;
            }
            catch(Exception e)
            {
                writeElementString(handler,"fromXmlErr","Fatal: "+e.toString());  
                return;
            }
           
            // xsValidate
            {
                xs.xsValidate(eb,"");
                if (eb.size() > 0)
                {
                    writeElementString(handler,"validateErr",eb.toString());
                }
                else
                {
                    writeElementString(handler,"validateOk","");
                }
View Full Code Here

Examples of org.xooof.xmlstruct.ErrorBag

    }
    else
    {
      if (mustBeValidated)
      {
        ErrorBag eb = new ErrorBag();
        if (!rqst.xsValidate(eb,"rqst"))
        {
          throw new XMLDispatcherUserException(eb.toString(),"XDE_VAL_RQST_INV");
        }
      }
    }
  }
View Full Code Here

Examples of org.xooof.xmlstruct.ErrorBag

    }
    else
    {
      if (mustBeValidated)
      {
        ErrorBag eb = new ErrorBag();
        if (!rply.xsValidate(eb,"rply"))
        {
          throw new XMLDispatcherAppException(eb.toString(),"XDE_VAL_RPLY_INV");
        }
      }
    }
  }
View Full Code Here

Examples of org.xooof.xmlstruct.ErrorBag

  {
    try
    {
      if (xml != null && xml.length() > 0)
      {
        ErrorBag eb = new ErrorBag();
        XmlStruct o = XmlStructUtils.xsFromXML(xsFactory,xml,eb,"");
        if (o == null)
        {
          throw new XmlStructException("unmarshalling error: " + eb.toString());
        }
        else
        {
          return o;
        }
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.