[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/io/xml XMLFileReader.java, 1.3, 1.4
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-06-07 22:27:14
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/xml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20188 Modified Files: XMLFileReader.java Log Message: no message Index: XMLFileReader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/xml/XMLFileReader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XMLFileReader.java 5 Jun 2006 22:40:34 -0000 1.3 --- XMLFileReader.java 6 Jun 2006 21:19:33 -0000 1.4 *************** *** 117,122 **** { exception.printStackTrace(); ! //logger.fatal(); ! throw new RuntimeException("Exception while reading the record. Message = " + exception.getMessage()); } } --- 117,122 ---- { exception.printStackTrace(); ! logger.fatal("Exception while reading the record. Message = " + exception.getMessage(),exception); ! throw new FileParseException("Exception while reading the record. Message = " + exception.getMessage()); } } *************** *** 134,138 **** catch(XMLStreamException exception) { ! //logger.debug("Streamexception while closing the reader. Message = " + exception.getMessage(),exception); } finally --- 134,138 ---- catch(XMLStreamException exception) { ! logger.debug("Streamexception while closing the reader. Message = " + exception.getMessage(),exception); } finally *************** *** 259,263 **** catch(XMLStreamException exception) { ! throw new RuntimeException("XMLStream exception while retrieving the record. Message = " + exception.getMessage(), exception); } return readerRecord; --- 259,265 ---- catch(XMLStreamException exception) { ! exception.printStackTrace(); ! logger.fatal("XMLStream exception while retrieving the record. Message = " + exception.getMessage(), exception); ! throw new FileParseException("XMLStream exception while retrieving the record. Message = " + exception.getMessage()); } return readerRecord; *************** *** 276,287 **** public Object readField(String fieldName) { ! return readElement(fieldName); } ! public Object readElement(String elementName) { ! return fieldMap.get(elementName); } protected void writeElement(String fieldName, Object fieldValue) --- 278,309 ---- public Object readField(String fieldName) { ! return this.fieldMap.get(fieldName); } ! public String readSimpleElement(String elementName) { ! return (String)fieldMap.get(elementName); } + public ReaderRecord readCompositeElement(String elementName) + { + return (ReaderRecord)fieldMap.get(elementName); + } + + public List readMutlipleElements(String elementName) + { + Object fieldValue=this.fieldMap.get(elementName); + + if(fieldValue==null) + return null; + else if(fieldValue instanceof List) + return (List)fieldValue; + else + { + List fieldValueList=new ArrayList(); + fieldValueList.add(fieldValue); + return fieldValueList; + } + } protected void writeElement(String fieldName, Object fieldValue) |