public class LexAccessApi
extends java.lang.Object
History:
Modifier and Type | Field and Description |
---|---|
static int |
B_BEGIN
Option of finding lexical records with citation form begins with ...
|
static int |
B_CONTAIN
Option of finding lexical records with citation form contains ...
|
static int |
B_END
Option of finding lexical records with citation form ends with ...
|
static int |
B_EXACT
Option of finding lexical records with exact match of citation form
|
static int |
B_NONE
Option of finding lexical records with base form match ...
|
static int |
BASE
Show output in citation form only
|
static int |
BASE_DETAILS
Show output in citation form in details: EUI and category
|
static int |
INFL_VAR
Show output in all inflectional variants only
|
static int |
INFL_VAR_DETAILS
Show output in all inflectional variants in details
|
static java.lang.String |
LS_STR |
static int |
SPELL_VAR
Show output in citation form and spelling variants only
|
static int |
SPELL_VAR_DETAILS
Show output in citation form and spelling variants in details: EUI and category
|
static int |
TEXT
Output in text format
|
static int |
TEXT_XML
Output in text and XML format
|
static int |
XML
Output in XML format
|
Constructor and Description |
---|
LexAccessApi()
Creates a LexAccessApi object and initiate related data (default).
|
LexAccessApi(java.sql.Connection conn)
Creates a LexAccessApi object and initiate related data using a specified
database connection.
|
LexAccessApi(java.util.Hashtable<java.lang.String,java.lang.String> properties)
Creates a LexAccessApi object and initiate related data with properties
needs to be overwritten
|
LexAccessApi(java.lang.String configFile)
Creates a LexAccessApi object and initiate related data using a specified
configuration file.
|
LexAccessApi(java.lang.String configFile,
java.util.Hashtable<java.lang.String,java.lang.String> properties)
Creates a LexAccessApi object and initiate related data using a specified
configuration file with properties to be overwritten
|
Modifier and Type | Method and Description |
---|---|
void |
CleanUp()
A method to close the established database connection
|
void |
CloseConnection(java.sql.Connection conn)
A method to close the specified database connection
|
java.lang.String |
FormatResultToStr(LexAccessApiResult lexAccessApiResult,
java.lang.String inputTerm,
boolean showQuery,
java.lang.String query,
boolean noOutputFlag,
java.lang.String noOutputMsg,
boolean showTotalRecNum,
int lexRecordFormat,
java.lang.String fieldSep)
Format the result to a String by specifying options.
|
java.util.Vector<java.lang.String> |
GetBasesByEui(java.lang.String eui)
A method to get the base (uninflected) forms by specified EUI.
|
Configuration |
GetConfiguration()
A method to get the configuration object
|
java.sql.Connection |
GetConnection()
A method to get the established database connection
|
LexAccessApiResult |
GetLexRecords(java.lang.String input)
A method to get the Lexical records of an input (term or EUI).
|
LexAccessApiResult |
GetLexRecordsByBase(java.lang.String input,
int baseBy)
A method to get the Lexical records of an input (term or EUI).
|
LexAccessApiResult |
GetLexRecordsByCat(long category)
A method to get the Lexical records by specified category.
|
java.lang.String |
GetResultStrByBase(java.lang.String base,
int baseBy,
long category,
boolean showQuery,
java.lang.String query,
boolean noOutputFlag,
java.lang.String noOutputMsg,
boolean showTotalRecNum,
int lexRecordFormat,
java.lang.String fieldSep)
Get result in String by specifying base and it's criteria.
|
java.lang.String |
GetResultStrByCategory(long category,
boolean showQuery,
java.lang.String query,
boolean noOutputFlag,
java.lang.String noOutputMsg,
boolean showTotalRecNum,
int lexRecordFormat,
java.lang.String fieldSep)
Get result in String by specifying category in a long value.
|
java.lang.String |
GetResultStrByTerm(java.lang.String inputTerm,
long category,
boolean showQuery,
java.lang.String query,
boolean noOutputFlag,
java.lang.String noOutputMsg,
boolean showTotalRecNum,
int lexRecordFormat,
java.lang.String fieldSep)
Get result in String by specifying an input term.
|
boolean |
ResetDbConnection(java.lang.String dbVersion)
A method to reset the database connection to a new dbName
|
public static final java.lang.String LS_STR
public static final int TEXT
public static final int XML
public static final int TEXT_XML
public static final int BASE
public static final int BASE_DETAILS
public static final int SPELL_VAR
public static final int SPELL_VAR_DETAILS
public static final int INFL_VAR
public static final int INFL_VAR_DETAILS
public static final int B_NONE
public static final int B_BEGIN
public static final int B_CONTAIN
public static final int B_END
public static final int B_EXACT
public LexAccessApi()
CleanUp( ) method must be called to close Db connection after using this object
public LexAccessApi(java.lang.String configFile)
CleanUp( ) method must be called to close Db connection after using this object
configFile
- the absolute path of the configuration filepublic LexAccessApi(java.sql.Connection conn)
CleanUp( ) method must be called to close Db connection after using this object
conn
- database connectionpublic LexAccessApi(java.util.Hashtable<java.lang.String,java.lang.String> properties)
CleanUp( ) method must be called to close Db connection after using this object
properties
- override propertiespublic LexAccessApi(java.lang.String configFile, java.util.Hashtable<java.lang.String,java.lang.String> properties)
CleanUp( ) method must be called to close Db connection after using this object
configFile
- the absolute path of the configuration fileproperties
- properties to be overwrite in configpublic java.lang.String GetResultStrByTerm(java.lang.String inputTerm, long category, boolean showQuery, java.lang.String query, boolean noOutputFlag, java.lang.String noOutputMsg, boolean showTotalRecNum, int lexRecordFormat, java.lang.String fieldSep) throws java.sql.SQLException
CleanUp( ) method must be called to close Db connection after using this object
inputTerm
- a String for term or EUIcategory
- a long value for the output category filtershowQuery
- a boolean flag for showing input queryquery
- a String of input querynoOutputFlag
- a boolean flag for showing message if no outputnoOutputMsg
- a String of no output messageshowTotalRecNum
- a boolean flag for showing total retrieval numlexRecordFormat
- an int value for Text(0), Xml(1), TextXml(2),
base(3), baseDetail(4), spellingVars(5), SpellingVarsDetail(6),
inflectionalVars(7), inflectionalVarsDetail(8)fieldSep
- a String of field separatorjava.sql.SQLException
- if there is a database error happenspublic java.lang.String GetResultStrByBase(java.lang.String base, int baseBy, long category, boolean showQuery, java.lang.String query, boolean noOutputFlag, java.lang.String noOutputMsg, boolean showTotalRecNum, int lexRecordFormat, java.lang.String fieldSep) throws java.sql.SQLException
CleanUp( ) method must be called to close Db connection after using this object
base
- a String for basebaseBy
- base retrieve criteria, none, begin, contain, endcategory
- a long value for the output category filtershowQuery
- a boolean flag for showing input queryquery
- a String of input querynoOutputFlag
- a boolean flag for showing message if no outputnoOutputMsg
- a String of no output messageshowTotalRecNum
- a boolean flag for showing total retrieval numlexRecordFormat
- an int value for Text(0), Xml(1), TextXml(2),
base(3), baseDetail(4), spellingVars(5), SpellingVarsDetail(6),
inflectionalVars(7), inflectionalVarsDetail(8)fieldSep
- a String of field separatorjava.sql.SQLException
- if there is a database error happenspublic java.lang.String GetResultStrByCategory(long category, boolean showQuery, java.lang.String query, boolean noOutputFlag, java.lang.String noOutputMsg, boolean showTotalRecNum, int lexRecordFormat, java.lang.String fieldSep) throws java.sql.SQLException
CleanUp( ) method must be called to close Db connection after using this object
category
- a long value for the input categoryshowQuery
- a boolean flag for showing input queryquery
- a String of input querynoOutputFlag
- a boolean flag for showing message if no outputnoOutputMsg
- a String of no output messageshowTotalRecNum
- a boolean flag for showing total retrieval numlexRecordFormat
- an int value for Text(0), Xml(1), TextXml(2),
base(3), baseDetail(4), spellingVars(5), SpellingVarsDetail(6),
inflectionalVars(7), inflectionalVarsDetail(8)fieldSep
- a String of field separatorjava.sql.SQLException
- if there is a database error happenspublic java.lang.String FormatResultToStr(LexAccessApiResult lexAccessApiResult, java.lang.String inputTerm, boolean showQuery, java.lang.String query, boolean noOutputFlag, java.lang.String noOutputMsg, boolean showTotalRecNum, int lexRecordFormat, java.lang.String fieldSep) throws java.sql.SQLException
lexAccessApiResult
- the result from LexAccessApiinputTerm
- a String for term or EUIshowQuery
- a boolean flag for showing input queryquery
- a String of input querynoOutputFlag
- a boolean flag for showing message if no outputnoOutputMsg
- a String of no output messageshowTotalRecNum
- a boolean flag for showing total retrieval numlexRecordFormat
- an int value for Text(0), Xml(1), TextXml(2),
base(3), baseDetail(4), spellingVars(5), SpellingVarsDetail(6),
inflectionalVars(7), inflectionalVarsDetail(8)fieldSep
- a String of field separatorjava.sql.SQLException
- if there is a database error happenspublic LexAccessApiResult GetLexRecords(java.lang.String input) throws java.sql.SQLException
input
- an inflected term or EUIjava.sql.SQLException
- if there is a database error happenspublic LexAccessApiResult GetLexRecordsByBase(java.lang.String input, int baseBy) throws java.sql.SQLException
input
- an inflected termbaseBy
- base retrieve criteriajava.sql.SQLException
- if there is a database error happenspublic LexAccessApiResult GetLexRecordsByCat(long category) throws java.sql.SQLException
category
- specified categoryjava.sql.SQLException
- if there is a database error happenspublic java.util.Vector<java.lang.String> GetBasesByEui(java.lang.String eui) throws java.sql.SQLException
eui
- specified EUIjava.sql.SQLException
- if there is a database error happenspublic Configuration GetConfiguration()
public java.sql.Connection GetConnection()
public boolean ResetDbConnection(java.lang.String dbVersion)
dbVersion
- database version to be used, YYYY(ASCII)public void CleanUp()
public void CloseConnection(java.sql.Connection conn)
conn
- the specified database connection to be closed Submit a bug or feature
Copyright © 2016 National Library of Medicine