- enhance public api classes
- add @usage tags to util classes
- add unit tests for Row update/delete methods, add/update *FromMap methods
+- add reason to unsupop throws for indexes
* this cursor and returns a modifiable Iterator which will iterate through
* all the rows of this table in reverse order. Use of the Iterator follows
* the same restrictions as a call to {@link #getPreviousRow}.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> reverseIterable();
* all the rows of this table in reverse order, returning only the given
* columns. Use of the Iterator follows the same restrictions as a call to
* {@link #getPreviousRow}.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> reverseIterable(
* Iterator which will iterate through all the rows of this table. Use of
* the Iterator follows the same restrictions as a call to
* {@link #getNextRow}.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterator<Row> iterator();
* this table and returns a modifiable Iterator which will iterate through
* all the rows of this table, returning only the given columns. Use of the
* Iterator follows the same restrictions as a call to {@link #getNextRow}.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> iterable(
* the Iterator follows the same restrictions as a call to {@link
* #getNextRow}. See {@link #findFirstRow(Column,Object)} for details on
* #the columnPattern.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> columnMatchIterable(
* returning only the given columns. Use of the Iterator follows the same
* restrictions as a call to {@link #getNextRow}. See {@link
* #findFirstRow(Column,Object)} for details on the columnPattern.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> columnMatchIterable(
* all the rows of this table which match the given row pattern. Use of the
* Iterator follows the same restrictions as a call to {@link #getNextRow}.
* See {@link #findFirstRow(Map)} for details on the rowPattern.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> rowMatchIterable(
* only the given columns. Use of the Iterator follows the same
* restrictions as a call to {@link #getNextRow}. See {@link
* #findFirstRow(Map)} for details on the rowPattern.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> rowMatchIterable(
/**
* @return an unmodifiable Iterator of the user Tables in this Database.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
* @throws ConcurrentModificationException if a table is added to the
* database while an Iterator is in use.
/**
* Returns a modifiable Iterator which will iterate through all the rows of
* this table which match the given index entries.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterator<Row> entryIterator(Object... entryValues);
* Returns a modifiable Iterator which will iterate through all the rows of
* this table which match the given index entries, returning only the given
* columns.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterator<Row> entryIterator(
/**
* Returns an Iterable whose iterator() method returns the result of a call
* to {@link #entryIterator(Object...)}
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> entryIterable(Object... entryValues);
/**
* Returns an Iterable whose iterator() method returns the result of a call
* to {@link #entryIterator(Collection,Object...)}
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> entryIterable(
--- /dev/null
+/*
+Copyright (c) 2013 James Ahlborn
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+*/
+
+package com.healthmarketscience.jackcess;
+
+import java.io.IOException;
+
+/**
+ * RuntimeException wrapper around an IOException
+ *
+ * @author James Ahlborn
+ */
+public class RuntimeIOException extends IllegalStateException
+{
+ private static final long serialVersionUID = 20130315L;
+
+ public RuntimeIOException(IOException e)
+ {
+ this(((e != null) ? e.getMessage() : null), e);
+ }
+
+ public RuntimeIOException(String msg, IOException e)
+ {
+ super(msg, e);
+ }
+}
import com.healthmarketscience.jackcess.util.ColumnMatcher;
import com.healthmarketscience.jackcess.Column;
import com.healthmarketscience.jackcess.Row;
+import com.healthmarketscience.jackcess.RuntimeIOException;
import com.healthmarketscience.jackcess.Index;
import com.healthmarketscience.jackcess.util.SimpleColumnMatcher;
* Iterator which will iterate through all the rows of this table, returning
* only the given columns. Use of the Iterator follows the same
* restrictions as a call to <code>getNextRow</code>.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterator<Row> iterator(Collection<String> columnNames)
* match the given column pattern. Use of the Iterator follows the same
* restrictions as a call to <code>getNextRow</code>. See
* {@link #findFirstRow(Column,Object)} for details on the columnPattern.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterator<Row> columnMatchIterator(
* the Iterator follows the same restrictions as a call to
* <code>getNextRow</code>. See {@link #findFirstRow(Column,Object)} for
* details on the columnPattern.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterator<Row> columnMatchIterator(
* match the given row pattern. Use of the Iterator follows the same
* restrictions as a call to <code>getNextRow</code>. See
* {@link #findFirstRow(Map)} for details on the rowPattern.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterator<Row> rowMatchIterator(
* the Iterator follows the same restrictions as a call to
* <code>getNextRow</code>. See {@link #findFirstRow(Map)} for details on
* the rowPattern.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterator<Row> rowMatchIterator(
_hasNext = findNext();
_validRow = _hasNext;
} catch(IOException e) {
- throw new IllegalStateException(e);
+ throw new RuntimeIOException(e);
}
}
return _hasNext;
_hasNext = null;
return rtn;
} catch(IOException e) {
- throw new IllegalStateException(e);
+ throw new RuntimeIOException(e);
}
}
deleteCurrentRow();
_validRow = false;
} catch(IOException e) {
- throw new IllegalStateException(e);
+ throw new RuntimeIOException(e);
}
} else {
throw new IllegalStateException("Not at valid row");
import com.healthmarketscience.jackcess.PropertyMap;
import com.healthmarketscience.jackcess.Relationship;
import com.healthmarketscience.jackcess.Row;
+import com.healthmarketscience.jackcess.RuntimeIOException;
import com.healthmarketscience.jackcess.Table;
import com.healthmarketscience.jackcess.query.Query;
import com.healthmarketscience.jackcess.util.CaseInsensitiveColumnMatcher;
try {
_tableNameIter = getTableNames().iterator();
} catch(IOException e) {
- throw new IllegalStateException(e);
+ throw new RuntimeIOException(e);
}
}
try {
return getTable(_tableNameIter.next());
} catch(IOException e) {
- throw new IllegalStateException(e);
+ throw new RuntimeIOException(e);
}
}
}
import com.healthmarketscience.jackcess.IndexCursor;
import com.healthmarketscience.jackcess.Row;
import com.healthmarketscience.jackcess.RowId;
+import com.healthmarketscience.jackcess.RuntimeIOException;
import com.healthmarketscience.jackcess.impl.TableImpl.RowState;
import com.healthmarketscience.jackcess.util.CaseInsensitiveColumnMatcher;
import com.healthmarketscience.jackcess.util.ColumnMatcher;
_hasNext = findFirstRowByEntryImpl(rowValues, true);
_validRow = _hasNext;
} catch(IOException e) {
- throw new IllegalStateException(e);
+ throw new RuntimeIOException(e);
}
}
* Iterator which will iterate through all the rows of this table. Use of
* the Iterator follows the same restrictions as a call to
* <code>getNextRow</code>.
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
* @usage _general_method_
*/
import java.io.IOException;
+import com.healthmarketscience.jackcess.RuntimeIOException;
import com.healthmarketscience.jackcess.Table;
import com.healthmarketscience.jackcess.impl.ColumnImpl;
((cs1 != null) && (cs2 != null) &&
cs1.toString().equalsIgnoreCase(cs2.toString())));
} catch(IOException e) {
- throw new IllegalStateException("Could not read column " + columnName
- + " value", e);
+ throw new RuntimeIOException("Could not read column " + columnName
+ + " value", e);
}
}
*
* @param fromRow row from the "from" table (which must include the relevant
* columns for this join relationship)
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> findRowsIterable(Map<String,?> fromRow)
* @param fromRow row from the "from" table (which must include the relevant
* columns for this join relationship)
* @param columnNames desired columns in the from table row
- * @throws IllegalStateException if an IOException is thrown by one of the
+ * @throws RuntimeIOException if an IOException is thrown by one of the
* operations, the actual exception will be contained within
*/
public Iterable<Row> findRowsIterable(