public class GeneralQueryBuilder extends ANetricsQueryBuilderBuilderBase
In addition to the standard query builder operations this class supports generating and compiling java classes that build the queries defined by the XML file.
ANetricsQueryBuilderBuilderBase.AndQlt, ANetricsQueryBuilderBuilderBase.CognateQueryField, ANetricsQueryBuilderBuilderBase.ConfidenceType, ANetricsQueryBuilderBuilderBase.CoreMatchCaseQlt, ANetricsQueryBuilderBuilderBase.FirstValidQlt, ANetricsQueryBuilderBuilderBase.OrQlt, ANetricsQueryBuilderBuilderBase.SimpleQueryField, ANetricsQueryBuilderBuilderBase.SupportingMatchCaseQlt
Constructor and Description |
---|
GeneralQueryBuilder()
Creat an uninitialized general query builder object.
|
GeneralQueryBuilder(com.tibco.patterns.qbp.jaxb.GeneralBuilderConfig input_config,
AQBPLogger logger)
Create a new general query builder from a configuration object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
generateSource(java.io.File generated_source_directory,
AQBPLogger logger)
Generate code for this query builder.
|
com.netrics.likeit.NetricsQuery |
getQuery()
Return a query object for the current field values.
|
boolean |
installCustomClasses(java.io.File generated_class_directory,
AQBPLogger logger)
Install the custom classes for this query builder.
|
java.lang.Object |
setConfiguration(java.io.File config_file)
Configure this object from a configuration file.
|
java.lang.Object |
setConfiguration(java.io.InputStream config_stream)
Configure this object from an input stream.
|
void |
setConfiguration(java.lang.Object config_object)
Configure this object from a GeneralQueryBuilderConfig object.
|
java.lang.Object |
setConfiguration(java.lang.String config_src)
Configure this object from a configuration source.
|
void |
setFileMgr(IQBPFileMgr file_manager)
Set the file manager used by this query builder.
|
andQuery, cognateQuery, dateQuery, firstValidQuery, matchCaseQuery, orQuery, predicateQuery, referenceQuery, rlinkQuery, simpleQuery, weightByFieldQuery
changeItemName, changeItemNames, getCurInputFieldNames, getCurItemName, getCurItemName, getCurItemNames, getCurJoinedFieldName, getCurJoinedFieldNames, getCurOutputFieldName, getCurOutputFieldNames, getDefaultItemNames, getDfltInputNames, getDfltOutputNames, getExtraData, getFieldValueArray, getFieldValues, getInputFieldNames, getUsedItemTypes, mapDataString, mapPredicateString, setDefaultValue, setDfltInputFields, setDfltItemNames, setDfltOutputFields, setExtraData, setFieldValues, setFieldValues, setFieldValues, setInputFieldName, setInputFieldNames, setInputFieldOrdering, setJoinTable, setOutputFieldName, setOutputFieldNames, setQueryConfiguration, setSearchOpts
public GeneralQueryBuilder()
public GeneralQueryBuilder(com.tibco.patterns.qbp.jaxb.GeneralBuilderConfig input_config, AQBPLogger logger) throws java.lang.IllegalArgumentException, AQBPLogger.QBPException, AQBPLogger.QBPConfigException
input_config
- the definition of the query to be built.
This includes information needed to generate the
class files.logger
- a logger used to log all messages and errors.java.lang.IllegalArgumentException
- if any argument is null.AQBPLogger.QBPConfigException
- if a fatal configuration error
is encountered or a configuration error is encountered and
exception mode is on in the logger.AQBPLogger.QBPException
- if a fatal error is encountered or
an error is encountered and exception mode is on in the
logger.public java.lang.Object setConfiguration(java.io.InputStream config_stream) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException, java.lang.IllegalStateException
setConfiguration
in class com.netrics.likeit.ANetricsQueryBuilder
config_stream
- this must be an open stream containing
a valid XML GeneralBuilderConfig item.java.lang.IllegalArgumentException
- if config_stream is null,
or does not contain a GeneralBuilderConfig XML as
the top level item.java.lang.IllegalStateException
- if this object is already initialized.java.lang.UnsupportedOperationException
public java.lang.Object setConfiguration(java.lang.String config_src) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException, java.lang.IllegalStateException
setConfiguration
in class com.netrics.likeit.ANetricsQueryBuilder
config_src
- this must be file source containing
a valid GeneralBuilderConfig XML element.java.lang.IllegalArgumentException
- if config_src is null, is not
an existing, readable source, or does not contain
a GeneralBuilderConfig XML as the top level item.java.lang.IllegalStateException
- if this object is already initialized.java.lang.UnsupportedOperationException
public java.lang.Object setConfiguration(java.io.File config_file) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException, java.lang.IllegalStateException
setConfiguration
in class com.netrics.likeit.ANetricsQueryBuilder
config_file
- this must be an XML file containing
a valid GeneralQueryBuilder element.java.lang.IllegalArgumentException
- if config_file is null, is not
an existing, readable file, or does not contain
a GeneralBuilderConfig XML as the top level item.java.lang.IllegalStateException
- if this object is already initialized.java.lang.UnsupportedOperationException
public void setConfiguration(java.lang.Object config_object) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException, java.lang.IllegalStateException
setConfiguration
in class com.netrics.likeit.ANetricsQueryBuilder
config_object
- this must be a valid GeneralBuilderConfig
object.java.lang.IllegalArgumentException
- if config_object is null, is not
an instance of GeneralBuilderConfig or is invalid.java.lang.IllegalStateException
- if this object is already initialized.java.lang.UnsupportedOperationException
public com.netrics.likeit.NetricsQuery getQuery() throws java.lang.IllegalStateException, java.lang.Exception
getQuery
in class com.netrics.likeit.ANetricsQueryBuilder
java.lang.IllegalStateException
- if this object is not initialized,
or if the GeneralQueryBuilder is based on a user
class, or if any feature uses a custom query
class, or if the field values are not set.java.lang.Exception
- on other errors.public void setFileMgr(IQBPFileMgr file_manager)
file_manager
- the file manager to use.java.lang.IllegalArgumentException
- if file_manager is null.public boolean generateSource(java.io.File generated_source_directory, AQBPLogger logger) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, AQBPLogger.QBPException
generated_source_directory
- this is the root directory
where the generated source is placed. This directory
must exist. Source files are generated into
sub-directories under this directory following standard
java package directory conventions. The sub-directories
are created as needed.logger
- a logger used to log all messages and errors.java.lang.IllegalArgumentException
- if any argument is null.java.lang.IllegalStateException
- if this object is not initialized.AQBPLogger.QBPException
- if exception mode is on and an error
is encountered or if a fatal error is encountered. Otherwise
all errors are logged without throwing an exception.public boolean installCustomClasses(java.io.File generated_class_directory, AQBPLogger logger) throws java.lang.IllegalArgumentException, AQBPLogger.QBPException
generated_class_directory
- this is the root directory
where the custom class files are placed. This directory
must exist. Class files are copied into sub-directories
under this directory following standard java package
directory conventions. The sub-directories are created
as needed.logger
- a logger used to log all messages and errors.java.lang.IllegalArgumentException
- if any argument is null.AQBPLogger.QBPException
- if exception mode is on and an error
is encountered or if a fatal error is encountered.
Otherwise all errors are logged without throwing an exception.