public class JaxenXmlDataSource extends AbstractXmlDataSource
EXCEPTION_MESSAGE_KEY_CANNOT_CONVERT_FIELD_TYPE, EXCEPTION_MESSAGE_KEY_CANNOT_MODIFY_PROPERTIES_AFTER_START, EXCEPTION_MESSAGE_KEY_NODE_NOT_AVAILABLE, EXCEPTION_MESSAGE_KEY_NULL_DOCUMENT, EXCEPTION_MESSAGE_KEY_NULL_SELECT_EXPRESSION, EXCEPTION_MESSAGE_KEY_UNKNOWN_COLUMN_NAME, EXCEPTION_MESSAGE_KEY_UNKNOWN_NUMBER_TYPE
Constructor and Description |
---|
JaxenXmlDataSource(Document document)
Creates the data source by parsing the xml document from the given file.
|
JaxenXmlDataSource(Document document,
String selectExpression)
Creates the data source by parsing the xml document from the given file.
|
JaxenXmlDataSource(File file)
Creates the data source by parsing the xml document from the given file.
|
JaxenXmlDataSource(File file,
String selectExpression)
Creates the data source by parsing the xml document from the given file.
|
JaxenXmlDataSource(InputStream in)
Creates the data source by parsing the xml document from the given input stream.
|
JaxenXmlDataSource(InputStream in,
String selectExpression)
Creates the data source by parsing the xml document from the given input stream.
|
JaxenXmlDataSource(String uri)
Creates the data source by parsing the xml document from the given system identifier (URI).
|
JaxenXmlDataSource(String uri,
String selectExpression)
Creates the data source by parsing the xml document from the given system identifier (URI).
|
Modifier and Type | Method and Description |
---|---|
AbstractXmlDataSource |
dataSource(String selectExpr)
Creates a sub data source using as root document the document used by "this" data source.
|
Node |
getCurrentNode() |
Object |
getSelectObject(Node currentNode,
String expression) |
void |
moveFirst()
Moves back to the first element in the data source.
|
boolean |
next()
Tries to position the cursor on the next element in the data source.
|
void |
setDetectXmlNamespaces(boolean detectXmlNamespaces) |
void |
setDocumentBuilderFactory(DocumentBuilderFactory documentBuilderFactory) |
void |
setXmlNamespaceMap(Map<String,String> xmlNamespaceMap) |
AbstractXmlDataSource |
subDataSource(String selectExpr)
Creates a sub data source using the current node (record) as the root
of the document.
|
Document |
subDocument()
Creates a document using the current node as root.
|
dataSource, getFieldValue, getText, subDataSource
convertNumber, convertStringValue, getConvertBean, getDatePattern, getFormattedDate, getFormattedNumber, getLocale, getNumberPattern, getTextAttributes, getTimeZone, setDatePattern, setLocale, setLocale, setNumberPattern, setTextAttributes, setTextAttributes, setTimeZone, setTimeZone
public JaxenXmlDataSource(Document document) throws JRException
document
- the documentJRException
- if the data source cannot be createdpublic JaxenXmlDataSource(Document document, String selectExpression) throws JRException
document
- the documentselectExpression
- the XPath select expressionJRException
- if the data source cannot be createdpublic JaxenXmlDataSource(InputStream in) throws JRException
in
- the input streamJRException
JRXmlDataSource.JRXmlDataSource(Document)
public JaxenXmlDataSource(InputStream in, String selectExpression) throws JRException
public JaxenXmlDataSource(String uri) throws JRException
If the system identifier is a URL, it must be full resolved.
uri
- the system identifierJRException
JRXmlDataSource.JRXmlDataSource(Document)
public JaxenXmlDataSource(String uri, String selectExpression) throws JRException
public JaxenXmlDataSource(File file) throws JRException
file
- the fileJRException
JRXmlDataSource.JRXmlDataSource(Document)
public JaxenXmlDataSource(File file, String selectExpression) throws JRException
public void moveFirst() throws JRException
JRRewindableDataSource
JRException
public boolean next() throws JRException
JRDataSource
JRException
- if any error occurs while trying to move to the next elementpublic Document subDocument() throws JRException
AbstractXmlDataSource
subDocument
in class AbstractXmlDataSource
JRException
public void setXmlNamespaceMap(Map<String,String> xmlNamespaceMap) throws JRException
JRException
public void setDetectXmlNamespaces(boolean detectXmlNamespaces)
public void setDocumentBuilderFactory(DocumentBuilderFactory documentBuilderFactory)
public Node getCurrentNode()
getCurrentNode
in class AbstractXmlDataSource
public Object getSelectObject(Node currentNode, String expression) throws JRException
getSelectObject
in class AbstractXmlDataSource
JRException
public AbstractXmlDataSource subDataSource(String selectExpr) throws JRException
AbstractXmlDataSource
subDataSource
in class AbstractXmlDataSource
selectExpr
- the XPath select expressionJRException
- if the sub data source couldn't be createdJRXmlDataSource.JRXmlDataSource(Document, String)
public AbstractXmlDataSource dataSource(String selectExpr) throws JRException
AbstractXmlDataSource
dataSource
in class AbstractXmlDataSource
selectExpr
- the XPath select expressionJRException
- if the sub data source couldn't be createdJRXmlDataSource.JRXmlDataSource(Document, String)
Copyright © 2016. All rights reserved.