Package com.microstar.xml

Examples of com.microstar.xml.XmlException


                        } else if (reply == ErrorHandler.CANCEL) {
                            // NOTE: Since we have to throw an XmlException for
                            // the exception to be properly handled, we communicate
                            // that it is a user cancellation with the special
                            // string pattern "*** Canceled." in the message.
                            throw new XmlException("*** Canceled.",
                                    _currentExternalEntity(), _getLineNumber(),
                                    _getColumnNumber());
                        }
                    } else {
                        // No handler.  Throw the original exception.
                        throw ex;
                    }
                }
            }
        }

        // Process delete requests that have accumulated in
        // this element.
        if (_deleteRequests != null) {
            Iterator requests = _deleteRequests.iterator();

            while (requests.hasNext()) {
                DeleteRequest request = (DeleteRequest) requests.next();

                // Be sure to use the handler if these fail so that
                // we continue to the next link requests.
                try {
                    request.execute();
                } catch (Exception ex) {
                    if (_handler != null) {
                        int reply = _handler.handleError(request.toString(),
                                _current, ex);

                        if (reply == ErrorHandler.CONTINUE) {
                            continue;
                        } else if (reply == ErrorHandler.CANCEL) {
                            // NOTE: Since we have to throw an XmlException for
                            // the exception to be properly handled, we communicate
                            // that it is a user cancellation with the special
                            // string pattern "*** Canceled." in the message.
                            throw new XmlException("*** Canceled.",
                                    _currentExternalEntity(), _getLineNumber(),
                                    _getColumnNumber());
                        }
                    } else {
                        // No handler.  Throw the original exception.
View Full Code Here


     */
    private void _processUnlink(String relation1Name, String relation2Name)
            throws XmlException, IllegalActionException {
        // Check that required arguments are given
        if ((relation1Name == null) || (relation2Name == null)) {
            throw new XmlException("Element unlink requires two relations.",
                    _currentExternalEntity(), _getLineNumber(),
                    _getColumnNumber());
        }

        CompositeEntity context = (CompositeEntity) _current;
View Full Code Here

        if (relationName != null) {
            countArgs++;
        }

        if (countArgs != 1) {
            throw new XmlException("Element unlink requires exactly one of "
                    + "an index, an insideIndex, or a relation.",
                    _currentExternalEntity(), _getLineNumber(),
                    _getColumnNumber());
        }
View Full Code Here

        // Now we are assured that name is relative.
        result = _current.getAttribute(name);

        if (result == null) {
            throw new XmlException("No such property: " + name + " in "
                    + currentName, _currentExternalEntity(), _getLineNumber(),
                    _getColumnNumber());
        }

        return result;
View Full Code Here

        if (_current instanceof Entity) {
            result = ((Entity) _current).getPort(name);
        }

        if (result == null) {
            throw new XmlException("No such port: " + name + " in "
                    + topLevelName, _currentExternalEntity(), _getLineNumber(),
                    _getColumnNumber());
        }

        return result;
View Full Code Here

        if (_current instanceof CompositeEntity) {
            result = ((CompositeEntity) _current).getRelation(name);
        }

        if (result == null) {
            throw new XmlException("No such relation: " + name + " in "
                    + topLevelName, _currentExternalEntity(), _getLineNumber(),
                    _getColumnNumber());
        }

        return result;
View Full Code Here

     @param column The approximate column number of the error.
     *  @exception XmlException If called.
     */
    public void error(String message, String systemID, int line, int column)
            throws XmlException {
        throw new XmlException(message, _currentExternalEntity(), line, column);
    }
View Full Code Here

            if (ex instanceof XmlException) {
                throw (XmlException) ex;
            } else {
                String msg = "XML element \"" + elementName
                        + "\" triggers exception:\n  " + ex.toString();
                throw new XmlException(msg, _currentExternalEntity(), _parser
                        .getLineNumber(), _parser.getColumnNumber());
            }
        }
        _attributes.clear();
    }
View Full Code Here

     @exception XmlException If the object parameter is null.
     */
    protected void _checkForNull(Object object, String message)
            throws XmlException {
        if (object == null) {
            throw new XmlException(message, _currentExternalEntity(), _parser
                    .getLineNumber(), _parser.getColumnNumber());
        }
    }
View Full Code Here

                parser.parse(base, bin);
            } catch (Exception ex) {
                String msg;

                if (ex instanceof XmlException) {
                    XmlException xmlex = (XmlException) ex;
                    msg = "PlotMLApplication: failed to parse PlotML data:\n"
                            + "line: " + xmlex.getLine() + ", column: "
                            + xmlex.getColumn() + "\nIn entity: "
                            + xmlex.getSystemId() + "\n";
                } else {
                    msg = "PlotMLApplication: failed to parse PlotML data:\n";
                }

                System.err.println(msg + ex.toString());
View Full Code Here

TOP

Related Classes of com.microstar.xml.XmlException

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.