Package csv.impl

Class XmlReader

All Implemented Interfaces:
TableReader, Iterable<Object[]>, Iterator<Object[]>

public class XmlReader extends AbstractStreamTableReader
Reads from a XML file.
Author:
ralph
  • Field Details

  • Constructor Details

  • Method Details

    • init

      protected void init()
      Initializes reader.
    • close

      public void close()
      Closes the stream.
      Specified by:
      close in interface TableReader
      Overrides:
      close in class AbstractStreamTableReader
      See Also:
    • reset

      public void reset()
      Resets the reader.
      Specified by:
      reset in interface TableReader
      Overrides:
      reset in class AbstractStreamTableReader
      See Also:
    • hasNext

      public boolean hasNext()
      Returns true if there are more rows.
      See Also:
    • next

      public Object[] next()
      Returns the next row.
      See Also:
    • readNextRow

      protected void readNextRow()
      Reads the next row.
    • readHeaderRow

      protected void readHeaderRow()
      Reads the header row.
      Overrides:
      readHeaderRow in class AbstractTableReader
      See Also:
    • initParser

      protected void initParser()
      Initializes the XML parser thread.
    • deliverComments

      protected void deliverComments()
      Handles all comments that were registered for current row.
    • deliverComments

      protected void deliverComments(int rowIndex)
      Handles all comments that were registered for current row.
      Parameters:
      rowIndex - the index of the row to be processed
    • getRowTagName

      public String getRowTagName()
      Returns the row tag name.
      Returns:
      the rowTagName
    • setRowTagName

      public void setRowTagName(String rowTagName)
      Sets the row tag name.
      Parameters:
      rowTagName - the rowTagName to set
    • getColumnTagName

      public String getColumnTagName()
      Returns the column tag name.
      Returns:
      the columnTagName
    • setColumnTagName

      public void setColumnTagName(String columnTagName)
      Sets the column tag name.
      Parameters:
      columnTagName - the columnTagName to set
    • isUseColumnNameTags

      public boolean isUseColumnNameTags()
      Returns whether column names will be used as column tag names.
      Returns:
      the useColumnNameTags
    • setUseColumnNameTags

      public void setUseColumnNameTags(boolean useColumnNameTags)
      Sets whether column names will be used as column tag names.
      Parameters:
      useColumnNameTags - the useColumnNameTags to set
    • getColumnNameAttribute

      public String getColumnNameAttribute()
      Returns the attribute name of column tag that will contain the attribute name. This information is required only when isUseColumnNameTags() returns false.
      Returns:
      the columnNameAttribute
    • setColumnNameAttribute

      public void setColumnNameAttribute(String columnNameAttribute)
      Sets the attribute name of column tag that will contain the attribute name. This information is required only when isUseColumnNameTags() returns false.
      Parameters:
      columnNameAttribute - the columnNameAttribute to set
    • getColumnTypeAttribute

      public String getColumnTypeAttribute()
      Returns the attribute name of column tag that contains the type of value. The type is the value class and usually being used for type conversion.
      Returns:
      the columnTypeAttribute
    • setColumnTypeAttribute

      public void setColumnTypeAttribute(String columnTypeAttribute)
      Sets the attribute name of column tag that contains the type of value. The type is the value class and usually being used for type conversion.
      Parameters:
      columnTypeAttribute - the columnTypeAttribute to set