xmlBlaster 2.2.0 API

org.xmlBlaster.contrib.dbwriter.info
Class SqlRow

java.lang.Object
  extended by org.xmlBlaster.contrib.dbwriter.info.SqlRow

public class SqlRow
extends java.lang.Object


Field Summary
private  java.util.List attributeKeys
           
private  java.util.Map attributes
          Contains the attributes of this row.
private  boolean caseSensitive
           
static java.lang.String COL_TAG
           
private  java.lang.String colsRawContent
          If this is set, then no columns must be filled and this is used to print it out as xml
private  java.util.List columnKeys
           
private  java.util.Map columns
          Contains the colums of this row.
static java.lang.String NUM_ATTR
           
private  int position
           
static java.lang.String ROW_TAG
           
 
Constructor Summary
SqlRow(I_Info info, int position)
           
 
Method Summary
 void addAttributes(java.util.Map map)
          It copies (stores) all entries found in the map into the attributes.
private static void addCopyOfAttributesAndColumns(SqlRow source, SqlRow dest)
           
(package private) static void addProps(java.util.Map map, java.util.Map destinationMap, java.util.List destinationList)
          It copies (stores) all entries found in the map into the attributes.
protected  java.lang.Object clone()
           
 SqlRow cloneRow()
           
private static java.lang.String findStringEntry(java.lang.String name, java.util.List list, boolean doRemove)
          returns the client property with the given name out of the list.
 ClientProperty getAttribute(java.lang.String key)
          Returns the requested attribute.
 java.lang.String[] getAttributeNames()
           
 java.lang.String getColsRawContent()
           
 ClientProperty getColumn(java.lang.String key)
           
 java.lang.String[] getColumnNames()
           
 boolean isCaseSensitive()
           
 void renameColumn(java.lang.String oldName, java.lang.String newName)
          Renames the given column.
(package private) static void renameProp(java.lang.String oldName, java.lang.String newName, java.util.Map map, java.util.List list)
          Renames the given Property.
 void setAttribute(ClientProperty value)
          Stores the client property as a new value.
 void setAttribute(java.lang.String key, java.lang.String value)
          Stores the String as a new value.
 void setCaseSensitive(boolean caseSensitive)
           
(package private)  void setColsRawContent(java.lang.String colsRawContent)
          Used when filling one row directly from a result set (not by explicit setters).
 void setColumn(ClientProperty value)
          Stores the client property as a new value.
(package private) static void storeProp(ClientProperty value, java.util.Map map, java.util.List list)
          Stores the client property as a new value.
 java.lang.String toXml(java.lang.String extraOffset)
           
 java.lang.String toXml(java.lang.String extraOffset, boolean withRowTag)
           
 java.lang.String toXml(java.lang.String extraOffset, boolean withRowTag, boolean doTruncate, boolean forceReadable)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROW_TAG

public static final java.lang.String ROW_TAG
See Also:
Constant Field Values

COL_TAG

public static final java.lang.String COL_TAG
See Also:
Constant Field Values

NUM_ATTR

public static final java.lang.String NUM_ATTR
See Also:
Constant Field Values

attributes

private java.util.Map attributes
Contains the attributes of this row. The key is a string describing the name and the content is a ClientProperty


columns

private java.util.Map columns
Contains the colums of this row. The key is a String which stands for the column number and the content is a ClientProperty


attributeKeys

private java.util.List attributeKeys

columnKeys

private java.util.List columnKeys

position

private int position

caseSensitive

private boolean caseSensitive

colsRawContent

private java.lang.String colsRawContent
If this is set, then no columns must be filled and this is used to print it out as xml

Constructor Detail

SqlRow

public SqlRow(I_Info info,
              int position)
Method Detail

addCopyOfAttributesAndColumns

private static final void addCopyOfAttributesAndColumns(SqlRow source,
                                                        SqlRow dest)

cloneRow

public SqlRow cloneRow()

clone

protected java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getAttributeNames

public java.lang.String[] getAttributeNames()

getColumnNames

public java.lang.String[] getColumnNames()

addProps

static final void addProps(java.util.Map map,
                           java.util.Map destinationMap,
                           java.util.List destinationList)
It copies (stores) all entries found in the map into the attributes. As values only String and ClientProperty objects are allowed. If another type is found, an IllegalArgumentException is thrown. If null is passed, nothing is done.

Parameters:
map -

findStringEntry

private static final java.lang.String findStringEntry(java.lang.String name,
                                                      java.util.List list,
                                                      boolean doRemove)
returns the client property with the given name out of the list. If the list or the name are null, null is returned.

Parameters:
list -
doRemove - if true, the entry is removed.
Returns:

renameProp

static final void renameProp(java.lang.String oldName,
                             java.lang.String newName,
                             java.util.Map map,
                             java.util.List list)
                      throws java.lang.Exception
Renames the given Property. The property must not be null. If the new name is the same as the old name, nothing is done. If an entry with newName already exists it will be removed.

Parameters:
oldName - The name of the property to replace. If null an exception is thrown.
newName - The new name of the property. If null, an exception is thrown.
map - The map on which to operate.
list - The list on which to operate.
Throws:
java.lang.Exception

storeProp

static final void storeProp(ClientProperty value,
                            java.util.Map map,
                            java.util.List list)
Stores the client property as a new value. If the attribute is found, then its value is overwritten.

Parameters:
value - the value to store as an attribute.

getAttribute

public ClientProperty getAttribute(java.lang.String key)
Returns the requested attribute. If 'caseSensitive' has been set, the characters of the key are compared case sensitively. If it is set to false, then it first searches for the case sensitive match, if nothing is found it looks for the lowercase of the key, and finally if still no match it looks for the uppercase alternative. If none of these is found, null is returned.

Parameters:
key - the key of the attribute
Returns:
the ClientProperty object associated with the key, or if none found, null is returned.

setAttribute

public void setAttribute(ClientProperty value)
Stores the client property as a new value. It it exists already it is overwritten.

Parameters:
value - the value to store as an attribute.

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.String value)
Stores the String as a new value. The passed String is directly transformed into a ClientProperty object.

Parameters:
value - the value to store as an attribute.

addAttributes

public void addAttributes(java.util.Map map)
It copies (stores) all entries found in the map into the attributes. As values only String and ClientProperty objects are allowed. If another type is found, an IllegalArgumentException is thrown. If null is passed, nothing is done.

Parameters:
map -

getColumn

public ClientProperty getColumn(java.lang.String key)

setColumn

public void setColumn(ClientProperty value)
Stores the client property as a new value. Note that it is not allowed to store an attribute with the same name multiple times.

Parameters:
value - the value to store as an attribute.
Throws:
java.lang.IllegalArgumentException - if the entry already existed, if the value is null or if the raw columns have already been set.

renameColumn

public void renameColumn(java.lang.String oldName,
                         java.lang.String newName)
                  throws java.lang.Exception
Renames the given column. If a column with the new name exists, it is first removed.

Parameters:
oldName -
newName -
Throws:
java.lang.Exception - if one of the names is null

toXml

public java.lang.String toXml(java.lang.String extraOffset)

toXml

public java.lang.String toXml(java.lang.String extraOffset,
                              boolean withRowTag)

toXml

public final java.lang.String toXml(java.lang.String extraOffset,
                                    boolean withRowTag,
                                    boolean doTruncate,
                                    boolean forceReadable)

isCaseSensitive

public boolean isCaseSensitive()

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)

getColsRawContent

public java.lang.String getColsRawContent()

setColsRawContent

void setColsRawContent(java.lang.String colsRawContent)
Used when filling one row directly from a result set (not by explicit setters).

Parameters:
colsRawContent -
Throws:
java.lang.IllegalStateException - if at least one column has already been set.

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.