Project notes

xiaoxiao2021-03-06  20

A large number of open source projects are used in a recent project, which will be a simple introduction.

Now I am doing Interface in hand, our approach is to handle webonline, with the FLATWORM to implement the conversion of XML data and Java objects. The essence of FLATWORM is to use string.substring to divide the files we uploaded into small pieces, then consist of these small pieces to the valueObjcet we need; Javadoc

Suppose we need to transfer a school's student record to our system, the file format is as follows;

Name06 / 11/200303: 47: 12Behavior

Java_JESSIE06 / 11/200400: 00: 12GOOD

The output file is as follows:

Record nametypelengthv_namechar11v_datechar10v_timechar8v_behaviorChar20

We need to write the following data conversion description files for the above Layout.

According to the above profile we can write corresponding VO;

Public class studValue {

PRIVATE STRING NEME;

PRIVATE STRING Requestdate;

PRIVATE STRING REQUESTIME;

PRIVATE STRING BEHAVEIOR;

......

SET, GET method

......

}

Then what we have to do is to convert the files uploaded above to our write VO. The practice is as follows: // Read Data Transition Description XML File

FileFormat ff = Parser.loadConfigurationFile ("D: //star//trans//data//upload.xml");

/ / Read data files that need to be bound

InputStream IN = New FileInputStream ("D: //star//trans//data//java_jesie.txt");

BufferedReader BUFIN = New BufferedReader (IN);

MatchedRecord Results;

The record pointer can be moved via Results, which can be bound Value Object through Results GetBean.

All right. FLATWORM is introduced here: If you have any questions, please be able to see http://flatworm.sourceforge.net/;

Other open source projects will be introduced later in the future;

转载请注明原文地址:https://www.9cbs.com/read-40923.html

New Post(0)