< prev index next >

nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java

Print this page




  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.nashorn.api.tree;
  27 
  28 
  29 /**
  30  * Indicates that an unknown kind of Tree was encountered.  This
  31  * can occur if the language evolves and new kinds of Trees are
  32  * added to the {@code Tree} hierarchy.  May be thrown by a
  33  * {@linkplain TreeVisitor tree visitor} to indicate that the
  34  * visitor was created for a prior version of the language.
  35  *
  36  * @since 1.9
  37  */
  38 public class UnknownTreeException extends RuntimeException {
  39 
  40     private static final long serialVersionUID = 1L;
  41 
  42     private transient final Tree tree;
  43     private transient final Object parameter;
  44 
  45     /**
  46      * Creates a new {@code UnknownTreeException}.  The {@code p}
  47      * parameter may be used to pass in an additional argument with
  48      * information about the context in which the unknown element was
  49      * encountered; for example, the visit methods of {@link
  50      * TreeVisitor} may pass in their additional parameter.
  51      *
  52      * @param t the unknown tree, may be {@code null}
  53      * @param p an additional parameter, may be {@code null}
  54      */
  55     public UnknownTreeException(Tree t, Object p) {
  56         super("Unknown tree: " + t);




  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.nashorn.api.tree;
  27 
  28 
  29 /**
  30  * Indicates that an unknown kind of Tree was encountered.  This
  31  * can occur if the language evolves and new kinds of Trees are
  32  * added to the {@code Tree} hierarchy.  May be thrown by a
  33  * {@linkplain TreeVisitor tree visitor} to indicate that the
  34  * visitor was created for a prior version of the language.
  35  *
  36  * @since 9
  37  */
  38 public class UnknownTreeException extends RuntimeException {
  39 
  40     private static final long serialVersionUID = 1L;
  41 
  42     private transient final Tree tree;
  43     private transient final Object parameter;
  44 
  45     /**
  46      * Creates a new {@code UnknownTreeException}.  The {@code p}
  47      * parameter may be used to pass in an additional argument with
  48      * information about the context in which the unknown element was
  49      * encountered; for example, the visit methods of {@link
  50      * TreeVisitor} may pass in their additional parameter.
  51      *
  52      * @param t the unknown tree, may be {@code null}
  53      * @param p an additional parameter, may be {@code null}
  54      */
  55     public UnknownTreeException(Tree t, Object p) {
  56         super("Unknown tree: " + t);


< prev index next >