Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlError


            throws SAXException
        {
            if (beginsWithXml( prefix ) &&
                ! ( "xml".equals( prefix ) && _xml1998Uri.equals( uri ) ))
            {
                XmlError err =
                    XmlError.forMessage(
                        "Prefix can't begin with XML: " + prefix,
                        XmlError.SEVERITY_ERROR );

                throw
                    new XmlRuntimeException(
                        err.toString(), null, err );
            }
        }
View Full Code Here


                }
            }

            if (sb != null)
            {
                XmlError err = XmlError.forCursor(sb.toString(), c.newCursor());
                throw new XmlException( err.toString(), null, err );
            }
        }
        finally
        {
            c.dispose();
View Full Code Here

                }
            }

            if (sb != null)
            {
                XmlError err = XmlError.forCursor(sb.toString(), c.newCursor());
                throw new XmlException( err.toString(), null, err );
            }
        }
        finally
        {
            c.dispose();
View Full Code Here

        public boolean add(Object o)
        {
            if (o instanceof XmlError)
            {
                XmlError err = (XmlError)o;
                if (err.getSeverity() == XmlError.SEVERITY_ERROR)
                    log(err.toString(_baseURL), Project.MSG_ERR);
                else if (err.getSeverity() == XmlError.SEVERITY_WARNING)
                    log(err.toString(_baseURL), Project.MSG_WARN);
                else if (_noisy)
                    log(err.toString(_baseURL), Project.MSG_INFO);
            }
            return false;
        }
View Full Code Here

    public boolean add(Object o)
    {
        if (o instanceof XmlError)
        {
            XmlError err = (XmlError)o;
            if (err.getSeverity() == XmlError.SEVERITY_ERROR ||
                err.getSeverity() == XmlError.SEVERITY_WARNING)
                System.err.println(err.toString(_baseURL));
            else if (_noisy)
                System.out.println(err.toString(_baseURL));
        }
        return false;
    }
View Full Code Here

        }

        // Error
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < errorList.size(); i++) {
            XmlError error = (XmlError) errorList.get(i);
            logger.warn("Message: " + error.getMessage());
            logger.warn("Location of invalid XML: " + error.getCursorLocation().xmlText());
            stringBuilder.append("Message:" + error.getMessage());
            stringBuilder.append("Location of invalid XML: " + error.getCursorLocation().xmlText());
        }
        throw new UtilsException(stringBuilder.toString());
    }
View Full Code Here

        // printing contained messages.
        if ( !isValid )
        {
            for ( int i = 0; i < errorList.size(); i++ )
            {
                XmlError error = (XmlError) errorList.get( i );

                System.out.println( "\n" );
                System.out.println( "Message: " + error.getMessage() + "\n" );
                System.out.println( "Location of invalid XML: " +
                        error.getCursorLocation().xmlText() + "\n" );
            }
        }
        return isValid;
    }
View Full Code Here

        { addInfo(_errorListener, code, args); }

    // KHK: remove this
    public static void addError(Collection errorListener, String message, int code, XmlObject location)
    {
        XmlError err =
            XmlError.forObject(
                message,
                XmlError.SEVERITY_ERROR,
                location);
        errorListener.add(err);
View Full Code Here

        errorListener.add(err);
    }

    public static void addError(Collection errorListener, String code, Object[] args, XmlObject location)
    {
        XmlError err =
            XmlError.forObject(
              code,
              args,
              XmlError.SEVERITY_ERROR,
              location);
View Full Code Here

        errorListener.add(err);
    }
   
    public static void addError(Collection errorListener, String code, Object[] args, File location)
    {
        XmlError err =
            XmlError.forLocation(
                code,
                args,
                XmlError.SEVERITY_ERROR,
                location.toURI().toString(), 0, 0, 0);
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlError

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.