return currentRow;
}
protected void decodeNode( final Object obj, final Map retValue ) {
if ( obj instanceof TinyNodeImpl ) {
AxisIterator aIter = ( (TinyNodeImpl) obj ).iterateAxis( Axis.DESCENDANT );
Object descendent = aIter.next();
boolean processedChildren = false;
int columnIndex = 0;
while ( descendent != null ) {
if ( ( descendent instanceof TinyNodeImpl ) && ( ( (TinyNodeImpl) descendent )
.getNodeKind() == Type.ELEMENT ) ) {
TinyNodeImpl descNode = (TinyNodeImpl) descendent;
Object value = retValue.get( descNode.getDisplayName() );
if ( value == null ) {
value = XQResultSet.EMPTY_STR;
}
if ( !( XQResultSet.EMPTY_STR.equals( value ) ) ) {
value = value.toString() + XQResultSet.DELIM;
}
value = value.toString() + descNode.getStringValue();
if ( ( value != null )
&& !value.equals( "" ) && ( columnTypes != null ) && ( columnIndex >= 0 )
&& ( columnIndex < columnTypes.length ) ) { //$NON-NLS-1$
String columnType = columnTypes[columnIndex].trim();
if ( columnType.equals( "java.math.BigDecimal" ) ) { //$NON-NLS-1$
value = new BigDecimal( value.toString() );
} else if ( columnType.equals( "java.sql.Timestamp" ) ) { //$NON-NLS-1$
value = new Timestamp( Long.parseLong( value.toString() ) );
} else if ( columnType.equals( "java.sql.Date" ) ) { //$NON-NLS-1$
value = new Date( Long.parseLong( value.toString() ) );
} else if ( columnType.equals( "java.lang.Integer" ) ) { //$NON-NLS-1$
value = new Integer( Integer.parseInt( value.toString() ) );
} else if ( columnType.equals( "java.lang.Double" ) ) { //$NON-NLS-1$
value = new Double( Double.parseDouble( value.toString() ) );
} else if ( columnType.equals( "java.lang.Long" ) ) { //$NON-NLS-1$
value = new Long( Long.parseLong( value.toString() ) );
}
}
retValue.put( descNode.getDisplayName(), value );
processedChildren = true;
columnIndex++;
}
descendent = aIter.next();
}
if ( !processedChildren ) {
Object key = ( (TinyNodeImpl) obj ).getDisplayName();
Object value = ( (TinyNodeImpl) obj ).getStringValue();
retValue.put( key, value );