com.partnersoft.v3x.io.formats.xml
Class XMLDataRecordSource

java.lang.Object
  extended by com.partnersoft.v3x.data.DataRecordSource
      extended by com.partnersoft.v3x.io.formats.xml.XMLDataRecordSource

public class XMLDataRecordSource
extends DataRecordSource

A simple implementation of an XML reader that works on containers of homogenous entities.


Field Summary
 
Fields inherited from class com.partnersoft.v3x.data.DataRecordSource
iteratorWrapper, mapWrapper, parameters, showProgress, verbose
 
Constructor Summary
XMLDataRecordSource()
           
XMLDataRecordSource(java.lang.String url)
           
 
Method Summary
 void close()
          Do any cleanup needed.
 java.lang.String getDataRecordTag()
          Gets the value of dataRecordTag
 java.lang.String getSendString()
          Gets the value of sendString
 java.lang.String getUrl()
          Gets the value of url
protected  void initialize(java.util.ArrayList fieldNames)
          Populates the fieldNames list via the first line in the CSV file.
 boolean isUseAttributes()
          Gets the value of useAttributes
 boolean isUseContents()
          Gets the value of useContents
protected  boolean nextRecord(java.util.ArrayList fillThis)
          Subclasses must implement this to set the current values in the given arraylist.
 void setDataRecordTag(java.lang.String argDataRecordTag)
          Sets the value of dataRecordTag
 void setSendString(java.lang.String argSendString)
          Sets the value of sendString
 void setUrl(java.lang.String argUrl)
          Sets the value of url
 void setUseAttributes(boolean argUseAttributes)
          Sets the value of useAttributes
 void setUseContents(boolean argUseContents)
          Sets the value of useContents
 
Methods inherited from class com.partnersoft.v3x.data.DataRecordSource
asIterator, asMap, clear, clone, containsKey, containsValue, copyStateFrom, entrySet, fieldNames, fieldValues, get, getAfterActions, getBeforeActions, getContentsMap, getParameters, getPosition, getShowProgress, getTransforms, getTransformScript, hasNext, initialize, isEmpty, isVerbose, keySet, next, put, putAll, remove, remove, reset, setAfterActions, setBeforeActions, setParameters, setShowProgress, setTransforms, setTransformScript, setVerbose, size, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDataRecordSource

public XMLDataRecordSource()

XMLDataRecordSource

public XMLDataRecordSource(java.lang.String url)
Method Detail

initialize

protected void initialize(java.util.ArrayList fieldNames)
Populates the fieldNames list via the first line in the CSV file.

Specified by:
initialize in class DataRecordSource

nextRecord

protected boolean nextRecord(java.util.ArrayList fillThis)
Description copied from class: DataRecordSource
Subclasses must implement this to set the current values in the given arraylist. While this does require pulling all values from e.g. a ResultSet, it prevents oddities such as the can-only-fetch-once bug in MSAccess. The list will already be populated with values, so set(index, value) will work for all indices (assuming your record is the same size as the fieldNames list, of course). It is not nulled out, so be sure to set all values. This is done as a prefetch; return true if the prefetch succeeds.

Specified by:
nextRecord in class DataRecordSource

close

public void close()
Description copied from class: DataRecordSource
Do any cleanup needed. Be sure to call super.close().

Overrides:
close in class DataRecordSource

getSendString

public java.lang.String getSendString()
Gets the value of sendString

Returns:
the value of sendString

setSendString

public void setSendString(java.lang.String argSendString)
Sets the value of sendString

Parameters:
argSendString - Value to assign to this.sendString

getUrl

public java.lang.String getUrl()
Gets the value of url

Returns:
the value of url

setUrl

public void setUrl(java.lang.String argUrl)
Sets the value of url

Parameters:
argUrl - Value to assign to this.url

getDataRecordTag

public java.lang.String getDataRecordTag()
Gets the value of dataRecordTag

Returns:
the value of dataRecordTag

setDataRecordTag

public void setDataRecordTag(java.lang.String argDataRecordTag)
Sets the value of dataRecordTag

Parameters:
argDataRecordTag - Value to assign to this.dataRecordTag

isUseAttributes

public boolean isUseAttributes()
Gets the value of useAttributes

Returns:
the value of useAttributes

setUseAttributes

public void setUseAttributes(boolean argUseAttributes)
Sets the value of useAttributes

Parameters:
argUseAttributes - Value to assign to this.useAttributes

isUseContents

public boolean isUseContents()
Gets the value of useContents

Returns:
the value of useContents

setUseContents

public void setUseContents(boolean argUseContents)
Sets the value of useContents

Parameters:
argUseContents - Value to assign to this.useContents