public abstract class AbstractDataSourceNode extends java.lang.Object implements DataSourceNode
Constructor and Description |
---|
AbstractDataSourceNode(AbstractDataSource abstractDataSource) |
Modifier and Type | Method and Description |
---|---|
boolean |
addQuery(QueryTag tag,
DataSourceNode[] stack)
Called for a query tag.
|
void |
addSet(SetTag tag,
DataSourceNode[] stack,
java.util.Locale locale,
IMacroState macroState)
Adds the set tag value to the usermap.
|
boolean |
addSwitch(SwitchTag tag,
DataSourceNode[] stack)
Called for a switch tag.
|
void |
close()
We are done with this node.
|
java.lang.Object |
drillDownToVal(java.lang.Object rtn,
java.lang.String tagType)
Drills through result sets to get the final return value.
|
void |
endSwitch(EndSwitchTag tag,
DataSourceNode[] stack)
Called when a switch ends.
|
boolean |
evaluate(java.lang.String text,
DataSourceNode[] stack,
IMacroState macroState)
Evaluate an expression for the boolean result.
|
java.io.InputStream |
getBitmap(OutTag tag,
DataSourceNode[] stack,
IMacroState state)
Called when tag is of type BITMAP.
|
java.lang.Object |
getCursor()
Returns the underlying cursor this node presently holds.
|
IChartDataSet |
getData(ChartTag tag,
DataSourceNode[] stack,
java.util.Locale locale)
Returns a set of data used to create a chart.
|
DataSourceProvider |
getDataSourceProvider()
Get the parent datasource.
|
DebugDatasourceState |
getDatasourceState(DataSourceNode[] stack)
Get the state of the datasource.
|
java.lang.Object[] |
getEquationData(java.lang.String query,
DataSourceNode[] stack,
java.util.Locale locale)
Returns an array of data from a given datasource query
|
java.lang.String |
getImport(ImportTag tag,
DataSourceNode[] stack)
Called for an import tag.
|
java.lang.String |
getImport(ImportTag tag,
DataSourceNode[] stack,
java.util.Locale locale,
IMacroState macroState)
An extended version of getImport() which supports the macro evaluation.
|
DataSourceIterator |
getIterator()
Returns the iterator presently in use for this node.
|
java.lang.String |
getLink(BaseTag tag,
DataSourceNode[] stack)
Called for a link or DrillDown tag.
|
java.lang.Object |
getNativeVariable(DataSourceNode[] stack,
java.lang.String var)
Gets the variable from a data provider on the stack.
|
java.lang.Object |
getOut(OutTag tag,
DataSourceNode[] stack,
java.util.Locale locale,
IMacroState state)
Called for an out tag.
|
InputDataContainer |
getOutStream(OutTag tag,
DataSourceNode[] stack,
IMacroState state)
Called for an out tag.
|
java.lang.String |
getValue(BaseTag tag,
DataSourceNode[] stack,
java.util.Locale locale,
IMacroState macroState) |
java.lang.Object[] |
getVariableValue(java.lang.String variable,
DataSourceNode[] stack,
java.util.Locale locale)
Returns the variable value.
|
boolean |
isCase(CaseTag tag,
DataSourceNode[] stack,
IMacroState macroState)
Called for a case tag.
|
boolean |
isExistingNode(BaseTag tag,
DataSourceNode[] stack)
Return true if the passed in node exists.
|
boolean |
isIf(IfTag tag,
DataSourceNode[] stack,
IMacroState macroState)
Called for an if tag.
|
boolean |
isLiteralDataSourceNode()
This is needed in parts of the code that do not know about the .NET version of the LiteralDataSourceNode,
for example if we are in cross compiled java code and we need to know if a DataSourceNode is an instance of
WindwardReportDrivers.net.windward.datasource.LiteralDatasource.LiteralDataSourceNode.
|
DataSourceIterator |
iterator(ForEachTag tag,
DataSourceNode[] stack)
Called for a forEach tag.
|
ParsedQuery |
parse(java.lang.String query,
DataSourceNode[] stack,
int mode,
int returnType,
java.lang.String tagType,
boolean ignoreUndefinedParams)
parses the query and gets variable results.
|
void |
setIterator(DataSourceIterator iter) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getQueryMode, isSelect
public AbstractDataSourceNode(AbstractDataSource abstractDataSource)
public boolean isLiteralDataSourceNode()
isLiteralDataSourceNode
in interface DataSourceNode
public java.lang.Object getNativeVariable(DataSourceNode[] stack, java.lang.String var)
getNativeVariable
in interface DataSourceNode
stack
- The current stack of data providers.var
- A variable to look up. It's in the form of ${...}.public void setIterator(DataSourceIterator iter)
setIterator
in interface DataSourceNode
public void addSet(SetTag tag, DataSourceNode[] stack, java.util.Locale locale, IMacroState macroState) throws DataSourceException
addSet
in interface DataSourceNode
tag
- The tag to addstack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will alwaysmacroState
- the macro state of the report
have length of at least 1.DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public boolean addQuery(QueryTag tag, DataSourceNode[] stack) throws DataSourceException
DataSourceNode
addQuery
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public java.io.InputStream getBitmap(OutTag tag, DataSourceNode[] stack, IMacroState state) throws DataSourceException
DataSourceNode
getBitmap
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.state
- macrostate of the reportDataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public java.lang.String getImport(ImportTag tag, DataSourceNode[] stack) throws DataSourceException
DataSourceNode
getImport
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public java.lang.String getImport(ImportTag tag, DataSourceNode[] stack, java.util.Locale locale, IMacroState macroState) throws DataSourceException
DataSourceNode
getImport
in interface DataSourceNode
DataSourceException
public java.lang.String getLink(BaseTag tag, DataSourceNode[] stack) throws DataSourceException
DataSourceNode
getLink
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public java.lang.String getValue(BaseTag tag, DataSourceNode[] stack, java.util.Locale locale, IMacroState macroState) throws DataSourceException
DataSourceException
public java.lang.Object getOut(OutTag tag, DataSourceNode[] stack, java.util.Locale locale, IMacroState state) throws DataSourceException
DataSourceNode
getOut
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.locale
- The locale to produce the output in.state
- The macro state of the reportDataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public java.lang.Object drillDownToVal(java.lang.Object rtn, java.lang.String tagType) throws DataSourceException
rtn
- Usually an IDataSourceResultSet or DataSourceResultRow that we need to drill intotagType
- The tag this is for. Can be null.DataSourceException
public InputDataContainer getOutStream(OutTag tag, DataSourceNode[] stack, IMacroState state) throws DataSourceException
DataSourceNode
getOutStream
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.state
- macrostate of the reportDataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public boolean isExistingNode(BaseTag tag, DataSourceNode[] stack) throws DataSourceException
DataSourceNode
isExistingNode
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public boolean evaluate(java.lang.String text, DataSourceNode[] stack, IMacroState macroState) throws DataSourceException
DataSourceNode
evaluate
in interface DataSourceNode
text
- The expression to evaluate.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.macroState
- macrostate of the reportDataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public boolean isIf(IfTag tag, DataSourceNode[] stack, IMacroState macroState) throws DataSourceException
DataSourceNode
isIf
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.macroState
- macrostate of the reportDataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public boolean addSwitch(SwitchTag tag, DataSourceNode[] stack) throws DataSourceException
DataSourceNode
addSwitch
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public boolean isCase(CaseTag tag, DataSourceNode[] stack, IMacroState macroState) throws DataSourceException
DataSourceNode
isCase
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.macroState
- macro state of the reportDataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public void endSwitch(EndSwitchTag tag, DataSourceNode[] stack)
DataSourceNode
endSwitch
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.public DataSourceIterator iterator(ForEachTag tag, DataSourceNode[] stack) throws DataSourceException
iterator
in interface DataSourceNode
tag
- The values that identify the datasource node to read.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public DataSourceIterator getIterator() throws DataSourceException
DataSourceNode
getIterator
in interface DataSourceNode
DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public void close() throws DataSourceException
DataSourceNode
close
in interface DataSourceNode
DataSourceException
- Could not retrieve the data.public IChartDataSet getData(ChartTag tag, DataSourceNode[] stack, java.util.Locale locale) throws DataSourceException
DataSourceNode
getData
in interface DataSourceNode
tag
- The wr:chart tag with the select setting to use.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.locale
- The locale to produce the output in.DataSourceException
- Could not retrieve the data.public java.lang.Object getCursor() throws DataSourceException
DataSourceNode
getCursor
in interface DataSourceNode
DataSourceException
- Could not retrieve the data. Generally wraps a SqlException or XpathException.public java.lang.Object[] getVariableValue(java.lang.String variable, DataSourceNode[] stack, java.util.Locale locale) throws DataSourceException
DataSourceNode
getVariableValue
in interface DataSourceNode
variable
- The string containing the variable name.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.locale
- The locale to produce the output in.DataSourceException
public java.lang.Object[] getEquationData(java.lang.String query, DataSourceNode[] stack, java.util.Locale locale) throws DataSourceException
DataSourceNode
getEquationData
in interface DataSourceNode
query
- The datasource query.stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.locale
- The locale to produce the output in.DataSourceException
public DebugDatasourceState getDatasourceState(DataSourceNode[] stack)
DataSourceNode
getDatasourceState
in interface DataSourceNode
stack
- The stack of forEach loops in at this point. Node [0] is the root document node so this will always
have length of at least 1.public ParsedQuery parse(java.lang.String query, DataSourceNode[] stack, int mode, int returnType, java.lang.String tagType, boolean ignoreUndefinedParams) throws DataSourceException
query
- The query to parse.stack
- The stack of forEach tags we're in the scope of. stack[0] is the root node.mode
- returnType
- tagType
- ignoreUndefinedParams
- ture to replace undefined ${vars} clauses in the select with "1 = 1". Should only
be used for getting metadata.DataSourceException
- thrown if anything goes wrong.public DataSourceProvider getDataSourceProvider()
DataSourceNode
getDataSourceProvider
in interface DataSourceNode
Copyright © 2002-2021 Windward Studios, LLC. - All Rights Reserved. We are Java document generation software