Hello,
I am a new comer to Castor and want to have more examples to study on. I used to find some one developerworks and javaworld but seems cannot satisfy my need.
I follow the example on JavaWorld but change with my own class:
import org.exolab.castor.xml.*;
import java.io.FileWriter;
import java.io.FileReader;
 
public class MyClass {
    Vector v1, v2, v3;
 
    public MyClass(Vector v1, Vector v2, Vector v3){
        this.v1 = v1;
        this.v2 = v2;
        this.v3 = v3;
   }

  public static void main(String args[]) {
  try {
    

    FileWriter file = new FileWriter("myclass.xml");
    Marshaller.marshal(this, file);
    file.close();
  } catch (Exception e) {
    System.out.println( e );
    }
  }
}
 
The result it generated is too simple to match my expection, how can I control the output in detail? Thanks!
 
Regards,
Sam Hwang
 

Reply via email to