00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 package org.jaebi.test.server.xml;
00012
00013 import java.io.File;
00014 import java.util.Iterator;
00015
00016 import org.jaebi.server.service.xml.JAXBMarshallerWrapper;
00017 import org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl;
00018 import org.jaebi.server.service.xml.exception.JAXBMarshallerWrapperInitException;
00019 import org.jaebi.server.service.xml.exception.JAXBMarshallerWrapperMarshallException;
00020 import org.jaebi.server.service.xml.exception.JAXBMarshallerWrapperUnmarshallException;
00021 import org.jaebi.server.service.xml.xrequest.Xrequest;
00022
00023
00028 public class MainTestJAXBXrequest {
00032 public static void main(String[] args) {
00033 JAXBMarshallerWrapper marshWrap = null;
00034 Xrequest xreqObj = null;
00035 File file = new File("/Users/detro/workspace-nb/JAEBI/XML-Examples/xrequest-example.select-002.xml");
00036 String XML = null;
00037
00038 try {
00039 marshWrap = new JAXBMarshallerWrapperImpl("org.jaebi.server.service.xml.xrequest");
00040 } catch ( JAXBMarshallerWrapperInitException e ) {
00041 e.printStackTrace();
00042 }
00043
00044 try {
00045 xreqObj = (Xrequest)marshWrap.unmarshall(file);
00046 } catch ( JAXBMarshallerWrapperUnmarshallException e ) {
00047 e.printStackTrace();
00048 }
00049
00050 try {
00051 marshWrap.setFormattedMarshalling(true);
00052 XML = marshWrap.marshall(xreqObj);
00053 } catch ( JAXBMarshallerWrapperMarshallException e ) {
00054 e.printStackTrace();
00055 }
00056
00057 System.out.println("output: ");
00058 System.out.println(XML);
00059
00060 System.out.println( "COLUMNS OBJECT: " + xreqObj.getColumns() );
00061
00062 System.out.println( "WHERE OBJECT: " + xreqObj.getWhere() );
00063
00064 System.out.println( "COLUMN LIST: " + xreqObj.getWhere().getColumn() );
00065 Iterator iter = xreqObj.getWhere().getColumn().iterator();
00066
00067 while ( iter.hasNext() )
00068 System.out.println(iter.next());
00069 }
00070
00071 }