View Javadoc
1   /*
2    * Copyright 2007 Kasper B. Graversen
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.supercsv.mock;
18  
19  import java.sql.ResultSetMetaData;
20  import java.sql.SQLException;
21  
22  class ResultSetMetaDataMock implements ResultSetMetaData {
23  	
24  	private String[] headers;
25  	
26  	public ResultSetMetaDataMock(final String[] headers) {
27  		this.headers = headers;
28  	}
29  
30  	public int getColumnCount() throws SQLException {
31  		return headers.length;
32  	}
33  	
34  	public String getColumnName(final int column) throws SQLException {
35  		return headers[column - 1];
36  	}
37  	
38  	/*
39  	 *  ------------------------------------------------------------------------
40  	 *   Unsupported methods follow.
41  	 *   Methods below this line shall only throw UnsupportedOperationException.
42  	 *  ------------------------------------------------------------------------
43  	 */
44  
45  	public <T> T unwrap(Class<T> iface) throws SQLException {
46  		throw new UnsupportedOperationException();
47  	}
48  
49  	public boolean isWrapperFor(Class<?> iface) throws SQLException {
50  		throw new UnsupportedOperationException();
51  	}
52  
53  	public boolean isAutoIncrement(int column) throws SQLException {
54  		throw new UnsupportedOperationException();
55  	}
56  
57  	public boolean isCaseSensitive(int column) throws SQLException {
58  		throw new UnsupportedOperationException();
59  	}
60  
61  	public boolean isSearchable(int column) throws SQLException {
62  		throw new UnsupportedOperationException();
63  	}
64  
65  	public boolean isCurrency(int column) throws SQLException {
66  		throw new UnsupportedOperationException();
67  	}
68  
69  	public int isNullable(int column) throws SQLException {
70  		throw new UnsupportedOperationException();
71  	}
72  
73  	public boolean isSigned(int column) throws SQLException {
74  		throw new UnsupportedOperationException();
75  	}
76  
77  	public int getColumnDisplaySize(int column) throws SQLException {
78  		throw new UnsupportedOperationException();
79  	}
80  
81  	public String getColumnLabel(int column) throws SQLException {
82  		throw new UnsupportedOperationException();
83  	}
84  
85  	public String getSchemaName(int column) throws SQLException {
86  		throw new UnsupportedOperationException();
87  	}
88  
89  	public int getPrecision(int column) throws SQLException {
90  		throw new UnsupportedOperationException();
91  	}
92  
93  	public int getScale(int column) throws SQLException {
94  		throw new UnsupportedOperationException();
95  	}
96  
97  	public String getTableName(int column) throws SQLException {
98  		throw new UnsupportedOperationException();
99  	}
100 
101 	public String getCatalogName(int column) throws SQLException {
102 		throw new UnsupportedOperationException();
103 	}
104 
105 	public int getColumnType(int column) throws SQLException {
106 		throw new UnsupportedOperationException();
107 	}
108 
109 	public String getColumnTypeName(int column) throws SQLException {
110 		throw new UnsupportedOperationException();
111 	}
112 
113 	public boolean isReadOnly(int column) throws SQLException {
114 		throw new UnsupportedOperationException();
115 	}
116 
117 	public boolean isWritable(int column) throws SQLException {
118 		throw new UnsupportedOperationException();
119 	}
120 
121 	public boolean isDefinitelyWritable(int column) throws SQLException {
122 		throw new UnsupportedOperationException();
123 	}
124 
125 	public String getColumnClassName(int column) throws SQLException {
126 		throw new UnsupportedOperationException();
127 	}
128 	
129 }