org.jwarp.xml
Class DataElement

org.jwarp.xml.DataElement

public class DataElement

Extends the Element class from JDOM to add content from ResultSet and HttpRequest classes.

Version:
1.0
Author:
ORCA Systems GmbH, Martin Schäfer

Constructor Summary
DataElement(java.lang.String name)
          Creates an empty DataElement with the given name
 
Method Summary
 DataElement addContent(javax.servlet.http.HttpServletRequest request, java.lang.String listExtension)
          Adds the content (parameters) from the given HttpServletRequest to the Element.
 DataElement addContent(java.sql.ResultSet rs, java.lang.String recordName)
          Adds the content from the given ResultSet to the Element.
 DataElement addContent(java.sql.ResultSet rs, java.lang.String recordName, int maxRecords)
          Adds the content from the given ResultSet to the Element.
 DataElement addContent(java.sql.ResultSet rs, java.lang.String recordName, java.lang.String idField)
          Adds the content from the given ResultSet to the Element.
 DataElement addContent(java.sql.ResultSet rs, java.lang.String recordName, java.lang.String idField, int maxRecords)
          Adds the content from the given ResultSet to the Element.
 

Constructor Detail

DataElement

public DataElement(java.lang.String name)
Creates an empty DataElement with the given name
Method Detail

addContent

public DataElement addContent(java.sql.ResultSet rs,
                              java.lang.String recordName)
                       throws java.sql.SQLException
Adds the content from the given ResultSet to the Element. Every record is enclosed in its own tag. Note that the position of the ResulSet will be changed after the method returns. However, the ResultSet will not be changed in any other way.
Parameters:
rs - The ResultSet to add
recordName - The name of the record tag to delimit the records

addContent

public DataElement addContent(java.sql.ResultSet rs,
                              java.lang.String recordName,
                              int maxRecords)
                       throws java.sql.SQLException
Adds the content from the given ResultSet to the Element. Every record is enclosed in its own tag. Note that the position of the ResulSet will be changed after the method returns. However, the ResultSet will not be changed in any other way.
Parameters:
rs - The ResultSet to add
recordName - The name of the record tag to delimit the records
maxRecords - Maxium number of records to add.

addContent

public DataElement addContent(java.sql.ResultSet rs,
                              java.lang.String recordName,
                              java.lang.String idField)
                       throws java.sql.SQLException
Adds the content from the given ResultSet to the Element. Every record is enclosed in its own tag. Note that the position of the ResulSet will be changed after the method returns. However, the ResultSet will not be changed in any other way.
Parameters:
rs - The ResultSet to add
recordName - The name of the record tag to delimit the records
idField - Name of the field to use as ID. The ID will be added as attribute to the record tag.

addContent

public DataElement addContent(java.sql.ResultSet rs,
                              java.lang.String recordName,
                              java.lang.String idField,
                              int maxRecords)
                       throws java.sql.SQLException
Adds the content from the given ResultSet to the Element. Every record is enclosed in its own tag. Note that the position of the ResulSet will be changed after the method returns. However, the ResultSet will not be changed in any other way.
Parameters:
rs - The ResultSet to add
recordName - The name of the record tag to delimit the records
idField - Name of the field to use as ID. The ID will be added as attribute to the record tag.
maxRecords - Maxium number of records to add.

addContent

public DataElement addContent(javax.servlet.http.HttpServletRequest request,
                              java.lang.String listExtension)
Adds the content (parameters) from the given HttpServletRequest to the Element.
Parameters:
request - The parameters of this HttpServletRequest will be added as content.

©   O R C A   S y s t e m s