- tweak lookup apis (specify column vs column name)
- separate classes into more packages (api,builder,util,impl)
- remove debug log blocks
+- add Row interface
public static final String FK_ENFORCE_PROPERTY =
"com.healthmarketscience.jackcess.enforceForeignKeys";
- /**
- * default error handler used if none provided (just rethrows exception)
- * @usage _general_field_
- */
- public static final ErrorHandler DEFAULT_ERROR_HANDLER = new ErrorHandler() {
- public Object handleRowError(Column column, byte[] columnData,
- Location location, Exception error)
- throws IOException
- {
- // really can only be RuntimeException or IOException
- if(error instanceof IOException) {
- throw (IOException)error;
- }
- throw (RuntimeException)error;
- }
- };
-
- /**
- * default link resolver used if none provided
- * @usage _general_field_
- */
- public static final LinkResolver DEFAULT_LINK_RESOLVER = new LinkResolver() {
- public Database resolveLinkedDatabase(Database linkerDb,
- String linkeeFileName)
- throws IOException
- {
- return DatabaseBuilder.open(new File(linkeeFileName));
- }
- };
-
/**
* Enum which indicates which version of Access created the database.
* @usage _general_class_
/**
* Sets a new ErrorHandler. If {@code null}, resets to the
- * {@link #DEFAULT_ERROR_HANDLER}.
+ * {@link ErrorHandler#DEFAULT}.
* @usage _intermediate_method_
*/
public void setErrorHandler(ErrorHandler newErrorHandler);
/**
* Sets a new LinkResolver. If {@code null}, resets to the
- * {@link #DEFAULT_LINK_RESOLVER}.
+ * {@link LinkResolver#DEFAULT}.
* @usage _intermediate_method_
*/
public void setLinkResolver(LinkResolver newLinkResolver);
}
public ErrorHandler getErrorHandler() {
- return((_dbErrorHandler != null) ? _dbErrorHandler :
- DEFAULT_ERROR_HANDLER);
+ return((_dbErrorHandler != null) ? _dbErrorHandler : ErrorHandler.DEFAULT);
}
public void setErrorHandler(ErrorHandler newErrorHandler) {
}
public LinkResolver getLinkResolver() {
- return((_linkResolver != null) ? _linkResolver : DEFAULT_LINK_RESOLVER);
+ return((_linkResolver != null) ? _linkResolver : LinkResolver.DEFAULT);
}
public void setLinkResolver(LinkResolver newLinkResolver) {
* Handler for errors encountered while reading a column of row data from a
* Table. An instance of this class may be configured at the Database, Table,
* or Cursor level to customize error handling as desired. The default
- * instance used is {@link Database#DEFAULT_ERROR_HANDLER}, which just
- * rethrows any exceptions encountered.
+ * instance used is {@link #DEFAULT}, which just rethrows any exceptions
+ * encountered.
*
* @author James Ahlborn
*/
public interface ErrorHandler
{
+ /**
+ * default error handler used if none provided (just rethrows exception)
+ * @usage _general_field_
+ */
+ public static final ErrorHandler DEFAULT = new ErrorHandler() {
+ public Object handleRowError(Column column, byte[] columnData,
+ Location location, Exception error)
+ throws IOException
+ {
+ // really can only be RuntimeException or IOException
+ if(error instanceof IOException) {
+ throw (IOException)error;
+ }
+ throw (RuntimeException)error;
+ }
+ };
/**
* Handles an error encountered while reading a column of data from a Table
package com.healthmarketscience.jackcess;
+import java.io.File;
import java.io.IOException;
/**
*/
public interface LinkResolver
{
+ /**
+ * default link resolver used if none provided
+ * @usage _general_field_
+ */
+ public static final LinkResolver DEFAULT = new LinkResolver() {
+ public Database resolveLinkedDatabase(Database linkerDb,
+ String linkeeFileName)
+ throws IOException
+ {
+ return DatabaseBuilder.open(new File(linkeeFileName));
+ }
+ };
+
/**
* Returns the appropriate Database instance for the linkeeFileName from the
* given linkerDb.