< prev index next >

src/java.xml/share/classes/javax/xml/xpath/XPathException.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  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


  93      * Get the cause of this XPathException.
  94      *
  95      * @return Cause of this XPathException.
  96      */
  97     public Throwable getCause() {
  98         return super.getCause();
  99     }
 100 
 101     /**
 102      * Writes "cause" field to the stream.
 103      * The cause is got from the parent class.
 104      *
 105      * @param out stream used for serialization.
 106      * @throws IOException thrown by {@code ObjectOutputStream}
 107      *
 108      */
 109     private void writeObject(ObjectOutputStream out)
 110             throws IOException
 111     {
 112         ObjectOutputStream.PutField fields = out.putFields();
 113         fields.put("cause", (Throwable) super.getCause());
 114         out.writeFields();
 115     }
 116 
 117     /**
 118      * Reads the "cause" field from the stream.
 119      * And initializes the "cause" if it wasn't
 120      * done before.
 121      *
 122      * @param in stream used for deserialization
 123      * @throws IOException thrown by {@code ObjectInputStream}
 124      * @throws ClassNotFoundException  thrown by {@code ObjectInputStream}
 125      */
 126     private void readObject(ObjectInputStream in)
 127             throws IOException, ClassNotFoundException
 128     {
 129         ObjectInputStream.GetField fields = in.readFields();
 130         Throwable scause = (Throwable) fields.get("cause", null);
 131 
 132         if (super.getCause() == null && scause != null) {
 133             try {


   1 /*
   2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  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


  93      * Get the cause of this XPathException.
  94      *
  95      * @return Cause of this XPathException.
  96      */
  97     public Throwable getCause() {
  98         return super.getCause();
  99     }
 100 
 101     /**
 102      * Writes "cause" field to the stream.
 103      * The cause is got from the parent class.
 104      *
 105      * @param out stream used for serialization.
 106      * @throws IOException thrown by {@code ObjectOutputStream}
 107      *
 108      */
 109     private void writeObject(ObjectOutputStream out)
 110             throws IOException
 111     {
 112         ObjectOutputStream.PutField fields = out.putFields();
 113         fields.put("cause", super.getCause());
 114         out.writeFields();
 115     }
 116 
 117     /**
 118      * Reads the "cause" field from the stream.
 119      * And initializes the "cause" if it wasn't
 120      * done before.
 121      *
 122      * @param in stream used for deserialization
 123      * @throws IOException thrown by {@code ObjectInputStream}
 124      * @throws ClassNotFoundException  thrown by {@code ObjectInputStream}
 125      */
 126     private void readObject(ObjectInputStream in)
 127             throws IOException, ClassNotFoundException
 128     {
 129         ObjectInputStream.GetField fields = in.readFields();
 130         Throwable scause = (Throwable) fields.get("cause", null);
 131 
 132         if (super.getCause() == null && scause != null) {
 133             try {


< prev index next >