public class Dom4jDataSource extends DataSourceBase implements DataSourceProvider
| Modifier and Type | Class and Description |
|---|---|
class |
Dom4jDataSource.VarResults |
NAME_DATASET, NAME_JSON, NAME_LITERAL, NAME_ODATA, NAME_SFDC, NAME_SQL, NAME_XML, NAME_XML_1_0| Constructor and Description |
|---|
Dom4jDataSource(org.w3c.dom.Document document)
Create a DataSourceProvider that uses dom4j to traverse an xml stream.
|
Dom4jDataSource(org.dom4j.Document document,
boolean extractNamespaces)
Create a DataSourceProvider that uses dom4j to traverse an xml stream.
|
Dom4jDataSource(org.dom4j.Element node)
Create a DataSourceProvider that uses dom4j to traverse an xml stream.
|
Dom4jDataSource(java.io.InputStream xmlData)
Create a DataSourceProvider that uses an xml stream as the data and dom4j to traverse it.
|
Dom4jDataSource(java.io.InputStream xmlData,
java.io.InputStream schemaFile)
Create a DataSourceProvider that uses an xml stream as the data and dom4j to traverse it.
|
Dom4jDataSource(java.lang.String xmlData)
Create a DataSourceProvider that uses an xml string as the data and dom4j to traverse it.
|
Dom4jDataSource(java.lang.String xmlConnectionString,
java.lang.String schemaConnectionString)
Create a DataSourceProvider using the passed in connection strings.
|
| Modifier and Type | Method and Description |
|---|---|
void |
approveDenyModifySelect(BaseTag xmlTag)
Verifys that a tag select is approved by a user defined callback
Or denies by throwing a DatasourceException or modifies the select
|
void |
close()
Called when processing is complete.
|
static org.dom4j.io.SAXReader |
createSAXReader()
Create a SAXReader set to disallow XXE aattacks.
|
java.lang.String |
getDatasourceName()
returns the name of this type in the form "sql", "xml", etc.
|
java.lang.String |
getDefaultNamespacePrefix()
The prefixes for namespaces are pulled from the XML datasource.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParameters()
This call is for internal engine use only.
|
int |
getParamMode()
Get the parameter substitution mode.
|
int |
getQueryMode(java.lang.String query,
BaseTag tag)
Returns the query mode for this select.
|
DataSourceNode |
getRootNode()
Returns the root node for this data set.
|
TagAttributes[] |
getTagAttributes()
Returns the allowed attributes for all tags.
|
java.util.Date |
parseAsDate(java.lang.String str) |
void |
populateDatasourceException(DataSourceException exception,
BaseTag tag,
DataSourceNode[] stack)
Populates that properties in a DataSourceException via DataSourceException.setProperties().
|
void |
setDefaultNamespacePrefix(java.lang.String prefix)
The prefixes for namespaces are pulled from the XML datasource.
|
void |
SetNamespaces(XPathNamespace[] namespaces) |
void |
setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
This call is for internal engine use only.
|
void |
setParamMode(int paramMode)
Set the parameter substitution mode.
|
boolean |
supportsDataSets()
Does this datasource support data sets?
|
void |
validateTag(BaseTag xmlTag)
Verifys that a tag has all required attributes and no unknown attributes.
|
convertToInputStream, lookupVariablepublic Dom4jDataSource(java.lang.String xmlConnectionString,
java.lang.String schemaConnectionString)
throws DataConnectionException
xmlConnectionString - Connection string to read the XML file.schemaConnectionString - Connection string to read the schema. null if no schema.DataConnectionExceptionpublic Dom4jDataSource(java.io.InputStream xmlData,
java.io.InputStream schemaFile)
throws DataConnectionException
xmlData - A well formed xml data file.schemaFile - the schema file.DataConnectionException - thrown if anything goes wrong.public Dom4jDataSource(java.io.InputStream xmlData)
throws DataConnectionException
xmlData - A well formed xml data file.DataConnectionException - thrown if anything goes wrong.public Dom4jDataSource(java.lang.String xmlData)
throws DataConnectionException
xmlData - Well formed xml (not a filename to an XML file - this is XML in a string).DataConnectionException - thrown if anything goes wrong.public Dom4jDataSource(org.dom4j.Element node)
throws DataConnectionException
node - a Node created in dom4j pointing to all or part of a xml tree.DataConnectionExceptionpublic Dom4jDataSource(org.dom4j.Document document,
boolean extractNamespaces)
throws DataConnectionException
document - a dom4j document.extractNamespaces - true if namespaces need to be read from the document and set as namespaces. Set to
false if this has already been done. You must do this yourself if the document has a schema.DataConnectionExceptionpublic Dom4jDataSource(org.w3c.dom.Document document)
throws DataConnectionException
document - a w3c Document.DataConnectionExceptionpublic java.lang.String getDatasourceName()
getDatasourceName in interface DataSourceProviderpublic TagAttributes[] getTagAttributes()
getTagAttributes in interface DataSourceProviderpublic void validateTag(BaseTag xmlTag)
throws TagException
validateTag in interface DataSourceProviderxmlTag - The tag to checkTagException - thrown if illegal parameters passed in.public void approveDenyModifySelect(BaseTag xmlTag)
throws DataSourceException
approveDenyModifySelect in interface DataSourceProviderxmlTag - The tag to checkDataSourceException - thrown if illegal parameters passed in.public void populateDatasourceException(DataSourceException exception, BaseTag tag, DataSourceNode[] stack)
populateDatasourceException in interface DataSourceProviderexception - The exception to populate.tag - The tag we're processing. null if no tag.stack - The node stack at the time of the exception. null if not relevant.public void SetNamespaces(XPathNamespace[] namespaces)
public int getParamMode()
getParamMode in interface DataSourceProviderpublic void setParamMode(int paramMode)
setParamMode in interface DataSourceProviderparamMode - the parameter substitution mode.public void setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
setParameters in interface DataSourceProviderparameters - This object is directly assigned for use as it is shared. Therefore any changes to it after
this call effect the datasource.public java.util.Map<java.lang.String,java.lang.Object> getParameters()
getParameters in interface DataSourceProviderpublic void setDefaultNamespacePrefix(java.lang.String prefix)
prefix - The prefix used for the default namespace in xpath selects.public java.lang.String getDefaultNamespacePrefix()
public DataSourceNode getRootNode()
getRootNode in interface DataSourceProviderpublic void close()
close in interface DataSourceProviderpublic java.util.Date parseAsDate(java.lang.String str)
public int getQueryMode(java.lang.String query,
BaseTag tag)
getQueryMode in interface DataSourceProviderquery - The select to evaluate.tag - The tag this select is for. This may be null.public boolean supportsDataSets()
supportsDataSets in class DataSourceBasepublic static org.dom4j.io.SAXReader createSAXReader()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionCopyright © 2017 Windward Reports - All Rights Reserved. We are java reporting software