|
From: <tr...@us...> - 2003-10-30 00:15:59
|
Update of /cvsroot/babeldoc/babeldoc/modules/conversion/src/com/babeldoc/conversion/flatfile
In directory sc8-pr-cvs1:/tmp/cvs-serv1337/modules/conversion/src/com/babeldoc/conversion/flatfile
Modified Files:
ConversionUnmarshaller.java FlatFileConverter.java
Log Message:
Updates for segmented lines / cvs lines in the Conversion utilities.
Index: ConversionUnmarshaller.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/conversion/src/com/babeldoc/conversion/flatfile/ConversionUnmarshaller.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ConversionUnmarshaller.java 7 Aug 2003 21:09:02 -0000 1.2
--- ConversionUnmarshaller.java 30 Oct 2003 00:15:56 -0000 1.3
***************
*** 106,110 ****
/**
! * get the interparagraph skip
*
* @return
--- 106,110 ----
/**
! * getChild the interparagraph skip
*
* @return
***************
*** 113,117 ****
/**
! * get the characters to skip from the left
*
* @return
--- 113,117 ----
/**
! * getChild the characters to skip from the left
*
* @return
***************
*** 127,131 ****
/**
! * get the line separator
*
* @return
--- 127,131 ----
/**
! * getChild the line separator
*
* @return
***************
*** 148,152 ****
/**
! * get the row element
*
* @return
--- 148,152 ----
/**
! * getChild the row element
*
* @return
Index: FlatFileConverter.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/conversion/src/com/babeldoc/conversion/flatfile/FlatFileConverter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FlatFileConverter.java 19 Jul 2003 13:16:47 -0000 1.1
--- FlatFileConverter.java 30 Oct 2003 00:15:56 -0000 1.2
***************
*** 29,33 ****
/**
* handle csv conversions. Watch the errors and make sure that xml start and
! * end tags get handled correctly.
*
* @param is the data
--- 29,33 ----
/**
* handle csv conversions. Watch the errors and make sure that xml start and
! * end tags getChild handled correctly.
*
* @param is the data
***************
*** 85,89 ****
/**
* Convert the data. Depending on the setting of the type in the
! * unmarshaller the different converters get called.
*
* @param element the element underwhich to add the new elements (!!!)
--- 85,89 ----
/**
* Convert the data. Depending on the setting of the type in the
! * unmarshaller the different converters getChild called.
*
* @param element the element underwhich to add the new elements (!!!)
***************
*** 128,131 ****
--- 128,132 ----
*/
protected void errorComment(Element element, Exception e) {
+ e.printStackTrace();
element.addComment(e.toString());
}
***************
*** 213,217 ****
// the input stream from the field number that does not exist
// And protect against data duplication.
! if (fieldNum > pairs.length) {
throw new ConversionException(I18n.get("conversion.002",
new Integer(getUnmarshaller().getFields().length),
--- 214,218 ----
// the input stream from the field number that does not exist
// And protect against data duplication.
! if (fieldNum > pairs.length-1) {
throw new ConversionException(I18n.get("conversion.002",
new Integer(getUnmarshaller().getFields().length),
***************
*** 230,235 ****
private static void addElements(Element row, NameValuePair[] pairs) {
for(int j = 0; j < pairs.length; ++j) {
! Element element = row.addElement(pairs[j].getName());
! element.addText(pairs[j].getValue());
}
}
--- 231,238 ----
private static void addElements(Element row, NameValuePair[] pairs) {
for(int j = 0; j < pairs.length; ++j) {
! if(pairs[j]!=null) {
! Element element = row.addElement(pairs[j].getName());
! element.addText(pairs[j].getValue());
! }
}
}
***************
*** 268,278 ****
}
! // Ok get data - first check if we can get all the data
if (end > line.length()) {
! // can we get any of it?
if (line.length() < start) {
value = "";
}
! // Well, we get what we can.
else {
value = line.substring(start);
--- 271,281 ----
}
! // Ok getChild data - first check if we can getChild all the data
if (end > line.length()) {
! // can we getChild any of it?
if (line.length() < start) {
value = "";
}
! // Well, we getChild what we can.
else {
value = line.substring(start);
|