001/* Exception thrown on an attempt to evaluate MoML that 002 contains a missing class 003 004 Copyright (c) 2007-2014 The Regents of the University of California. 005 All rights reserved. 006 Permission is hereby granted, without written agreement and without 007 license or royalty fees, to use, copy, modify, and distribute this 008 software and its documentation for any purpose, provided that the above 009 copyright notice and the following two paragraphs appear in all copies 010 of this software. 011 012 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 013 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 014 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 015 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 016 SUCH DAMAGE. 017 018 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 019 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 020 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 021 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 022 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 023 ENHANCEMENTS, OR MODIFICATIONS. 024 025 PT_COPYRIGHT_VERSION_2 026 COPYRIGHTENDKEY 027 028 */ 029package ptolemy.moml; 030 031import com.microstar.xml.XmlException; 032 033/////////////////////////////////////////////////////////////////// 034//// UndefinedConstantOrIdentifer 035 036/** 037 Thrown on an attempt to evaluate MoML that 038 contains a missing class. 039 040 <p>This exception is used to catch missing classes in 041 during cut and paste operations by {@link ptolemy.moml.MoMLParser}. 042 043 @author Christopher Brooks 044 @version $Id$ 045 @since Ptolemy II 6.1 046 @Pt.ProposedRating Red (cxh) 047 @Pt.AcceptedRating Red (cxh) 048 */ 049@SuppressWarnings("serial") 050public class MissingClassException extends XmlException { 051 /** Construct a new XML parsing exception. 052 } 053 /** Constructs an Exception with a detail message that includes the 054 * name of the first argument. 055 * @param message The error message from the parser. 056 * @param missingClassName The name of the missing class. 057 * @param systemId The URI of the entity containing the error. 058 * @param line The line number where the error appeared. 059 * @param column The column number where the error appeared. 060 */ 061 public MissingClassException(String message, String missingClassName, 062 String systemId, int line, int column) { 063 super(message, systemId, line, column, null); 064 _missingClassName = missingClassName; 065 } 066 067 /////////////////////////////////////////////////////////////////// 068 //// public methods //// 069 070 /** Return the node name that caused the exception. 071 * @return the name of the unidentified constant or identifier 072 * that caused the exception. 073 */ 074 public String missingClassName() { 075 return _missingClassName; 076 } 077 078 /////////////////////////////////////////////////////////////////// 079 //// private variables //// 080 081 /** The name of the missing class. 082 */ 083 private String _missingClassName; 084}