XBRLAPI

A Java API for XBRL


org.xbrlapi.data.bdbxml.examples.utilities
Class BaseUtilityExample

java.lang.Object
  extended by org.xbrlapi.data.bdbxml.examples.utilities.BaseUtilityExample
Direct Known Subclasses:
AddAnIndex, AnalyseCacheForMatchedDocuments, AnalyseEntityResources, AnalyseLoadFailures, AnalysePersistedRelationships, AnalyseRelationshipsForAFragment, AnalyseUnitMeasures, DeletePersistedRelationships, DeleteSpecificDocument, DeleteStubs, FindLinksToGivenDocument, FindLocatorsWithMultipleTargetsForADocument, ListDuplicateStoredDocuments, ListStoredDocuments, LoadCacheDocuments, LoadSpecificDocument, PersistAllRelationshipsInStore, PersistRelationshipsInSpecifiedDocument, PurgeIdenticalDocuments, ReloadLoadFailures, ReportIdenticalDocuments, ReportUnitMisuses, TestQuery, UpdateAllRelationshipsInStore

public abstract class BaseUtilityExample
extends Object

Provides a base class that all of the concrete utility examples extend. Commandline arguments (optional ones marked with an *)

Author:
Geoffrey Shuetrim (geoff@galexy.net)

Field Summary
protected  String argumentDocumentation
           
protected  HashMap<String,String> arguments
           
protected  Cache cache
           
protected  Loader loader
           
protected static org.apache.log4j.Logger logger
           
protected  String problems
           
protected  Store store
           
protected  String usage
           
 
Constructor Summary
BaseUtilityExample()
           
 
Method Summary
protected  String addArgumentDocumentation()
          Provides documentation of the usage of the utility.
protected  void badUsage(String message)
          Report incorrect usage of the utility.
protected  void mapArgument(String name, String value)
          Adds an argument to the argument map.
protected  void parseArguments(String[] args)
          Responsible for parsing the command line arguments into a hashmap that maps from the text string that is the argument name (prefixed by a hyphen that is not part of the string used in the mapping) to the argument value, represented as a text string.
protected  String setUp()
          Sets up the database store, the loader and the cache.
protected  void tearDown()
          Closes the data store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

cache

protected Cache cache

store

protected Store store

loader

protected Loader loader

arguments

protected HashMap<String,String> arguments

argumentDocumentation

protected String argumentDocumentation

usage

protected String usage

problems

protected String problems
Constructor Detail

BaseUtilityExample

public BaseUtilityExample()
Method Detail

parseArguments

protected void parseArguments(String[] args)
Responsible for parsing the command line arguments into a hashmap that maps from the text string that is the argument name (prefixed by a hyphen that is not part of the string used in the mapping) to the argument value, represented as a text string.

Parameters:
args -

mapArgument

protected void mapArgument(String name,
                           String value)
Adds an argument to the argument map.

Parameters:
name - The argument name (including the leading hyphen).
value - The argument value.

setUp

protected String setUp()
Sets up the database store, the loader and the cache. Also checks that the base arguments (database, container and cache) have been supplied. (Overrides should also call this method).


tearDown

protected void tearDown()
Closes the data store. Overrides should also call this method.


badUsage

protected void badUsage(String message)
Report incorrect usage of the utility.

Parameters:
message - The error message.

addArgumentDocumentation

protected String addArgumentDocumentation()
Provides documentation of the usage of the utility. Override this to generate the utility documentation, calling this first to get the initial part of the documentation.

Returns:
the documentation of the command line arguments.

Get Java XBRL API implementation at SourceForge.net.