public class QuerySpecification
extends org.xml.sax.helpers.DefaultHandler
The printSQL() method can be used to print a SQL
serialization of the query.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTRIBUTESYMBOL |
static char |
PREDICATE_END |
static char |
PREDICATE_START |
Constructor and Description |
---|
QuerySpecification(java.io.Reader queryspec,
java.lang.String parserName,
java.lang.String accNumberSeparator)
construct an instance of the QuerySpecification class
|
QuerySpecification(java.lang.String accNumberSeparator)
construct an instance of the QuerySpecification class which don't need
to parser a xml document
|
QuerySpecification(java.lang.String queryspec,
java.lang.String parserName,
java.lang.String accNumberSeparator)
construct an instance of the QuerySpecification class
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
callback method used by the SAX Parser when the text sequences of an xml
stream are detected.
|
boolean |
containsExtendedSQL()
Returns true if the parsed query contains and extended xml query (i.e.
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
callback method used by the SAX Parser when the end tag of an element is
detected.
|
java.lang.String |
getAccessQuery()
Method to append a access control query to SQL.
|
static java.lang.String |
getAttributeName(java.lang.String path)
A method to get attribute name from path
|
java.util.Vector |
getFilterDocList()
Accessor method to return a vector of the filter doc types as defined in
the <filterdoctype> tag in the pathquery dtd.
|
java.lang.String |
getIdentifier()
Accessor method to return the identifier of this Query
|
java.lang.String |
getNormalizedXMLQuery()
Gets normailized query string in xml format, which can be transformed
to html
|
java.util.Vector |
getOwnerList()
Accessor method to return a vector of the owner fields as defined in the
<owner> tag in the pathquery dtd.
|
QueryGroup |
getQueryGroup()
get the QueryGroup used to express query constraints
|
java.lang.String |
getQueryTitle()
Accessor method to return the title of this Query
|
java.util.Vector |
getReturnDocList()
Accessor method to return a vector of the return document types as
defined in the <returndoctype> tag in the pathquery dtd.
|
java.util.Vector |
getReturnFieldList()
Accessor method to return a vector of the extended return fields as
defined in the <returnfield> tag in the pathquery dtd.
|
java.lang.String |
getSortedReturnFieldString()
Method to return a String generated after sorting the returnFieldList
Vector
|
void |
handleReturnField(java.lang.String inputString)
Method to handle return field.
|
boolean |
isPercentageSearch()
Method to indicate this query is a percentage search
|
static java.lang.String |
newPathExpressionWithOutAttribute(java.lang.String pathExpression)
A method to get rid of attribute part in path expression
|
java.lang.String |
printExtendedSQL(java.lang.String doclist,
boolean useXMLIndex,
java.util.List<java.lang.Object> allValues,
java.util.List<java.lang.Object> docListValues)
This method prints sql based upon the <returnfield> tag in the
pathquery document.
|
static java.lang.String |
printGetDocByDoctypeSQL(java.lang.String docid) |
static java.lang.String |
printRelationSQL(java.lang.String docid) |
java.lang.String |
printSQL(boolean useXMLIndex,
java.util.List<java.lang.Object> parameterValues)
create a SQL serialization of the query that this instance represents
|
void |
setContainsExtenedSQL(boolean hasExtenedQuery)
set if this query sepcification has extendQuery(has return doc type or
not)
|
void |
setFilterDocList(java.util.Vector filterDocList)
method to set the list of filter docs of this query
|
void |
setGroup(java.lang.String[] myGroup)
Method to set user group
|
void |
setIdentifier(java.lang.String id)
method to set the identifier of this query
|
void |
setOwnerList(java.util.Vector ownerList)
method to set the list of owners used to constrain this query
|
void |
setQueryGroup(QueryGroup group)
set the querygroup
|
void |
setQueryTitle(java.lang.String title)
method to set the title of this query
|
void |
setReturnDocList(java.util.Vector returnDocList)
method to set the list of return docs of this query
|
void |
setReturnFieldList(java.util.Vector returnFieldList)
method to set the list of fields to be returned by this query
|
void |
setUserName(java.lang.String myName)
Method to set user name
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
callback method used by the SAX Parser when the start tag of an element
is detected.
|
java.lang.String |
toString()
create a String description of the query that this instance represents.
|
public static final java.lang.String ATTRIBUTESYMBOL
public static final char PREDICATE_START
public static final char PREDICATE_END
public QuerySpecification(java.io.Reader queryspec, java.lang.String parserName, java.lang.String accNumberSeparator) throws java.io.IOException
queryspec
- the XML representation of the query (should conform to
pathquery.dtd) as a ReaderparserName
- the fully qualified name of a Java Class implementing the
org.xml.sax.XMLReader interfacejava.io.IOException
public QuerySpecification(java.lang.String queryspec, java.lang.String parserName, java.lang.String accNumberSeparator) throws java.io.IOException
queryspec
- the XML representation of the query (should conform to
pathquery.dtd) as a StringparserName
- the fully qualified name of a Java Class implementing the
org.xml.sax.Parser interfacejava.io.IOException
public QuerySpecification(java.lang.String accNumberSeparator) throws java.io.IOException
accNumberSeparator
- the separator between doc versionjava.io.IOException
public void setUserName(java.lang.String myName)
myName
- the user namepublic void setGroup(java.lang.String[] myGroup)
myGroup
- the user grouppublic boolean isPercentageSearch()
public java.lang.String getAccessQuery()
public boolean containsExtendedSQL()
public java.lang.String getIdentifier()
public void setIdentifier(java.lang.String id)
public java.lang.String getQueryTitle()
public void setQueryTitle(java.lang.String title)
public java.util.Vector getReturnDocList()
public void setReturnDocList(java.util.Vector returnDocList)
public java.util.Vector getFilterDocList()
public void setFilterDocList(java.util.Vector filterDocList)
public java.util.Vector getReturnFieldList()
public void setReturnFieldList(java.util.Vector returnFieldList)
public java.util.Vector getOwnerList()
public void setOwnerList(java.util.Vector ownerList)
public QueryGroup getQueryGroup()
public void setQueryGroup(QueryGroup group)
public void setContainsExtenedSQL(boolean hasExtenedQuery)
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public java.lang.String getNormalizedXMLQuery()
public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
public void handleReturnField(java.lang.String inputString)
inputString
- public java.lang.String printSQL(boolean useXMLIndex, java.util.List<java.lang.Object> parameterValues)
public java.lang.String printExtendedSQL(java.lang.String doclist, boolean useXMLIndex, java.util.List<java.lang.Object> allValues, java.util.List<java.lang.Object> docListValues)
doclist
- the list of document ids to searchunaccessableNodePair
- the node pairs (start id and end id) which
this user should not accessuseXMLIndex
- a boolean flag indicating whether to search using
xml_indexpublic java.lang.String getSortedReturnFieldString()
public static java.lang.String printRelationSQL(java.lang.String docid)
public static java.lang.String printGetDocByDoctypeSQL(java.lang.String docid)
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String newPathExpressionWithOutAttribute(java.lang.String pathExpression)
public static java.lang.String getAttributeName(java.lang.String path)
Copyright © 2020 Regents of the University of California. All Rights Reserved.