public class DBQueryDefParserEmitter extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BAD_FIELDNAME
a field name was used that could not be found in the schema
|
static int |
BAD_TABLENAME
a table name was used that could not be found in the schema
|
static int |
NO_QUERY_NODE
the XML was missing a "query" element
|
static int |
QUERY_ERROR
error building query
|
static int |
QUERY_OK
query was built OK
|
static java.lang.String |
WILDCARD |
| Constructor and Description |
|---|
DBQueryDefParserEmitter() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
createSQL(DSSchemaIFace aSchemaDef,
DBQueryDef aQueryDef)
Create SQL string
|
static java.lang.String |
emitXML(DBQueryDef aQueryDef)
Creates the XML that represents a query
|
static java.lang.String |
getErrorCodeText()
Return the text for the error code
|
static DBQueryDef |
parseQueryDef(DSSchemaIFace aSchema,
java.lang.String aXMLQueryStr)
Parses and creates a DBQueryDef object from an XML String
|
static DBQueryDef |
parseQueryDef(DSSchemaIFace aSchema,
java.lang.String aXMLQueryStr,
java.util.Hashtable aMappedNameHash)
Parses and creates a DBQueryDef object from an XML String
|
static DBQueryDef |
processDOM(DSSchemaIFace aSchema,
org.w3c.dom.Document aDoc)
Reads in a XML document that is a query definition
|
protected static DBWhereIFace |
processWhereNode(DSSchemaIFace aSchema,
org.w3c.dom.Node aNode,
DBWhereOperator aParent)
Processes the where node
|
static DBQueryDef |
readQueryDef(DSSchemaIFace aSchema,
java.lang.String aFileName)
Reads in a Query and returns a Query object
|
protected static boolean |
recurseWhere(java.lang.StringBuffer aStrBuf,
DBWhereIFace aWhereObj,
int aLevel)
Recurses through the "tree" of operators and creates a textual rendering
of the operators and conditions
|
public static final int QUERY_OK
public static final int QUERY_ERROR
public static final int NO_QUERY_NODE
public static final int BAD_TABLENAME
public static final int BAD_FIELDNAME
public static final java.lang.String WILDCARD
public DBQueryDefParserEmitter()
public static java.lang.String getErrorCodeText()
protected static DBWhereIFace processWhereNode(DSSchemaIFace aSchema, org.w3c.dom.Node aNode, DBWhereOperator aParent)
aSchema - the schemaaNode - the nodeaParent - the node's parentpublic static DBQueryDef processDOM(DSSchemaIFace aSchema, org.w3c.dom.Document aDoc)
aSchema - the schemaaDoc - the document DOMpublic static DBQueryDef readQueryDef(DSSchemaIFace aSchema, java.lang.String aFileName)
aSchema - the schemaaFileName - Name of XML file representing a XML documentpublic static DBQueryDef parseQueryDef(DSSchemaIFace aSchema, java.lang.String aXMLQueryStr, java.util.Hashtable aMappedNameHash)
aSchema - the schemaaXMLQueryStr - XML string representing a XML documentpublic static DBQueryDef parseQueryDef(DSSchemaIFace aSchema, java.lang.String aXMLQueryStr)
aSchema - the schemaaXMLQueryStr - XML string representing a XML documentprotected static boolean recurseWhere(java.lang.StringBuffer aStrBuf, DBWhereIFace aWhereObj, int aLevel)
aStrBuf - the output bufferaWhereObj - the where object treeaLevel - the level within the treepublic static java.lang.String emitXML(DBQueryDef aQueryDef)
public static java.lang.String createSQL(DSSchemaIFace aSchemaDef, DBQueryDef aQueryDef)