< prev index next >

src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java

Print this page

   1 /*
   2  * Copyright (c) 2003, 2014, 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

 928      * Returns true if this either implements the interface argument or is directly or indirectly a wrapper
 929      * for an object that does. Returns false otherwise. If this implements the interface then return true,
 930      * else if this is a wrapper then return the result of recursively calling <code>isWrapperFor</code> on the wrapped
 931      * object. If this does not implement the interface and is not a wrapper, return false.
 932      * This method should be implemented as a low-cost operation compared to <code>unwrap</code> so that
 933      * callers can use this method to avoid expensive <code>unwrap</code> calls that may fail. If this method
 934      * returns true then calling <code>unwrap</code> with the same argument should succeed.
 935      *
 936      * @param interfaces a Class defining an interface.
 937      * @return true if this implements the interface or directly or indirectly wraps an object that does.
 938      * @throws java.sql.SQLException  if an error occurs while determining whether this is a wrapper
 939      * for an object with the given interface.
 940      * @since 1.6
 941      */
 942     public boolean isWrapperFor(Class<?> interfaces) throws SQLException {
 943         return interfaces.isInstance(this);
 944     }
 945 
 946     static final long serialVersionUID = 6893806403181801867L;
 947 





 948     private class ColInfo implements Serializable {
 949         /**
 950          * The field that indicates whether the value in this column is a number
 951          * that is incremented automatically, which makes the value read-only.
 952          * <code>true</code> means that the value in this column
 953          * is automatically numbered; <code>false</code> means that it is not.
 954          *
 955          * @serial
 956          */
 957         public boolean autoIncrement;
 958 
 959         /**
 960          * The field that indicates whether the value in this column is case sensitive.
 961          * <code>true</code> means that it is; <code>false</code> that it is not.
 962          *
 963          * @serial
 964          */
 965         public boolean caseSensitive;
 966 
 967         /**

   1 /*
   2  * Copyright (c) 2003, 2020, 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

 928      * Returns true if this either implements the interface argument or is directly or indirectly a wrapper
 929      * for an object that does. Returns false otherwise. If this implements the interface then return true,
 930      * else if this is a wrapper then return the result of recursively calling <code>isWrapperFor</code> on the wrapped
 931      * object. If this does not implement the interface and is not a wrapper, return false.
 932      * This method should be implemented as a low-cost operation compared to <code>unwrap</code> so that
 933      * callers can use this method to avoid expensive <code>unwrap</code> calls that may fail. If this method
 934      * returns true then calling <code>unwrap</code> with the same argument should succeed.
 935      *
 936      * @param interfaces a Class defining an interface.
 937      * @return true if this implements the interface or directly or indirectly wraps an object that does.
 938      * @throws java.sql.SQLException  if an error occurs while determining whether this is a wrapper
 939      * for an object with the given interface.
 940      * @since 1.6
 941      */
 942     public boolean isWrapperFor(Class<?> interfaces) throws SQLException {
 943         return interfaces.isInstance(this);
 944     }
 945 
 946     static final long serialVersionUID = 6893806403181801867L;
 947 
 948     /**
 949      * {@code ColInfo} objects are used to store information
 950      * about each column in the {@code RowSet} object for which
 951      * this {@code RowSetMetaDataImpl} object was created.
 952      */
 953     private class ColInfo implements Serializable {
 954         /**
 955          * The field that indicates whether the value in this column is a number
 956          * that is incremented automatically, which makes the value read-only.
 957          * <code>true</code> means that the value in this column
 958          * is automatically numbered; <code>false</code> means that it is not.
 959          *
 960          * @serial
 961          */
 962         public boolean autoIncrement;
 963 
 964         /**
 965          * The field that indicates whether the value in this column is case sensitive.
 966          * <code>true</code> means that it is; <code>false</code> that it is not.
 967          *
 968          * @serial
 969          */
 970         public boolean caseSensitive;
 971 
 972         /**
< prev index next >