JSefa 0.9 released

Discussions

News: JSefa 0.9 released

  1. JSefa 0.9 released (8 messages)

    I am pleased to announce the 0.9 release of the JSefa (Java Simple Exchange Format API) project. JSefa provides an unified approch to high level pull-based streaming for XML, CSV, and FLR with Java 5 and above. It is motivated as follows: With JSR 173 (StAX) pull-based streaming for XML became popular. But JSR 173 is low level, i. e., one has to cope with elements and attributes and has no support for the transformation between the high level business objects and the low level XML constructs. On the other hand traditional high level APIs are not stream-based, thus processing a document requires loading it completely in memory. A first step to high level streaming is JAXB 2.0 as it provides an integration with StAX. But with JAXB 2.0 one has to use two APIs in parallel to achieve high level stream based processing of an XML document: StAX for low level selecting the relevant XML sections and JAXB for parsing these sections. It is rather awkhard to adjust the format of simple types, e. g. specifying a specific date format. There are a lot of other shortcomings that annoyed me. As a result I felt the need for a simpler approach which is inherently dedicated to streaming, easy to use, fast and modest in terms of memory usage. Moreover the approach should support CSV and FLR, as there is almost no open source library facilitating these format types. Furthermore it should provide 1) a unified high level API layer on which the knowledge of the format type is irrelevant, 2) a format type specific high level API layer for actions which are specific to the format type, and 3) a low level API layer if one needs to operate directly with low level constructs. The result is JSefa. JSefa has been under development for about half a year and has been deployed in several internal projects in the service industry for mass data processing. Now the first official version is released to the open source community. To get a first impression of how to use JSefa have a look at the quick tutorial: http://jsefa.sourceforge.net/quick-tutorial.html For an overview of the features of JSefa see http://jsefa.sourceforge.net/features.html To download or for more information about the JSefa project go to: http://jsefa.sourceforge.net There is also an introductory article in the Javamagazin (10.07, pp. 109-113). Any comments are welcome - especially ideas for further improvements of JSefa. Thank you for your interest! Norman

    Threaded Messages (8)

  2. good idea[ Go to top ]

    You are quite right that there are very limited CSV and FLR handling libraries. Wrote one myself that simply does the parsing without the bean creation (didn't put it out there in the open source for, well, hell, no idea). But I'm please to see your implementation. Is it also possible to use the library without beans? I mean, the files I usually get to import are a mix of info and I need to extract what is needed and then maybe create 2 or 3 beans from one line. So the direct link between source and bean is not preferred by me.
  3. Re: good idea[ Go to top ]

    Hi Tom, first of all, thank you for your interest. Working with JSefa at the High-Level API you need classes which can represent the relevant parts of the documents you want to process. E. g. you need a class Invoice when you want to extract the invoice elements of an XML document. For XML it is not necessary that such a class (along with its subclasses or referred classes) completely reflects the structure of the relevant parts of your document (e.g. reflect the invoice element with all its subelements etc.). Because CSV and FLR have no markup your classes generally have to completely reflect the structure of the document. But if your documents contain different types of records whereas the first field of each record denotes its type, you can selectively parse only the records of the type you are interested in. The same is true for sub records and sub record lists. But it is also possible to use JSefa at the Low-Level API. For example, for CSV use the CsvLowLevelIOFactory. With this factory you can create a LowLevelDeserializer, which provides low level methods like readNextRecord, readNextField etc. Then you are not bound to any high level classes. Can you post an example of your document for which you want to extract only relevant parts? Perhaps it is possible to do it at high level which is generally the preferred way. Norman
  4. Re: good idea[ Go to top ]

    Hey Norman, As said, I like the idea and have bookmarked the library for future considerat, but I have solved the issue I'm referring to with my own implementation, so there is no need to invest time in this. I only want to point out that with (often legacy) CSV / FLR imports, the data contained in a row usually does not match exactly one bean in the Java application. And I find it unpleasant to have to introduce a public dummy bean just for parsing a CSV. Although that of course is a matter of taste :-)
  5. As mentioned in the title, JSEFA sounds good (at least for me :) ). I'd like to give it a try right now but can't find any javadoc... Second point, any plans to work with the Spring-WS team to integrate it tightly as others are (JAXB, JiBX...) ?
  6. Hi David, you are right - I should consider to add the javadocs to the binary distribution. You can build the docs with the source distribution or look at http://jsefa.sourceforge.net/apidocs/index.html Up to now there is no plan to work with the Spring-WS team for any integration issues. I want to await the feedback of the open source community first to see what improvements and integration issues are most welcome. Norman
  7. Integration with Spring-WS[ Go to top ]

    Hi Norman, i really like the approaches of JSefa and would like to see JSefa tight integrated with Spring-WS. I will look at the Spring-Ws code to see how jsefa cn be integrated. Johannes
  8. The Jsefa has been very useful in my applications for its clean and uncluttered approach. We have a lot of existing domain objects where the date attributes are java.sql.Date. Is there an out of box solution in JSefa to parse the dates in xml (in form yyyy-MM-dd) to java.sql.Date. Thanks PB
  9. Hi Norman![ Go to top ]

    Hi Norman nice to see you here in this forum! We are working a lot with CSV, FLR and XML formats (Import, Export, Transform). I will take a deeper look at your framework. All the best, Lofi.