org.slamb.axamol.library
Class Library

java.lang.Object
  extended by org.slamb.axamol.library.Library

public class Library
extends java.lang.Object

Library of SQL statements stored in XML. This mostly just handles parsing. You need a LibraryConnection to use a Library.

Version:
$Id: Library.java 1205 2005-06-29 04:58:26Z slamb $
Author:
Scott Lamb <slamb@slamb.org>

Field Summary
static java.lang.String NS_LIBRARY
           
 
Constructor Summary
Library(java.lang.Class theClass, java.lang.String resourceName)
          Opens a library as a resource in the given class's ClassLoader instance.
Library(java.io.File libraryFile)
          Opens a library from a File.
Library(org.xml.sax.InputSource source)
          Opens a library from an InputSource.
 
Method Summary
 void clearTimings()
          Resets all peformance timings for each of this library's statements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NS_LIBRARY

public static final java.lang.String NS_LIBRARY
See Also:
Constant Field Values
Constructor Detail

Library

public Library(java.io.File libraryFile)
Opens a library from a File.

Throws:
java.lang.RuntimeException - if unable to parse the library. This is a RuntimeException because library files are considered part of the project's code. Thus, this is analagous to ClassFormatError.

Library

public Library(org.xml.sax.InputSource source)
Opens a library from an InputSource.

Throws:
java.lang.RuntimeException - if unable to find or parse the library. This is a RuntimeException because library files are considered part of the project's code. Thus, this is analagous to ClassFormatError.

Library

public Library(java.lang.Class theClass,
               java.lang.String resourceName)
Opens a library as a resource in the given class's ClassLoader instance. This is the most common way to open a library. See the "Instantiating libraries" section of the manual for an example.

Parameters:
theClass - The class whose ClassLoader should be used to load the resource. Typically, this is the caller's class. It can be any class in the same jar file as the library.
resourceName - The name of the resource, with no prefix. Slashes separate package names. Should have a ".xml" suffix.
Throws:
java.lang.RuntimeException - if unable to find, load, or parse the library. This is a RuntimeException because library files are considered part of the project's code. Thus, this is analagous to ClassNotFoundError or ClassFormatError.
Method Detail

clearTimings

public void clearTimings()
Resets all peformance timings for each of this library's statements. Use when the earlier timings are no longer valid—perhaps when adding indexes to the database.



Copyright © 2002-2006 Scott Lamb. All Rights Reserved.