Pessoal, n sei mais o que fazer com meu problema aqui.
Ja tentei usar JDOM, XStream, Jaxb eo carai a 4.
preciso salvar este objeto em xml.
public class Relatorio {
private List<Band> bands;
private List<Tabela> tabelas;
private List<OrderBy> orderBy;
private List<String> restricao;
public Relatorio() {
this.bands = new ArrayList<Band>();
this.tabelas = new ArrayList<Tabela>();
this.orderBy = new ArrayList<OrderBy>();
this.restricao = new ArrayList<String>();
}
}
public class Band {
private String nome;
private List<Function> functions;
private List<StaticText> staticTexts;
private List<TextField> textFields;
private List<Group> groups;
private CheckListItem item;
private boolean isGroup = false;
public Band(){
this.nome = "";
this.functions = new ArrayList<Function>();
this.staticTexts = new ArrayList<StaticText>();
this.textFields = new ArrayList<TextField>();
this.groups = new ArrayList<Group>();
this.item = new CheckListItem("");
this.isGroup = false;
}
}
//esse é o codigo que salva o objeto
Writer w = null;
try {
JAXBContext context = JAXBContext.newInstance(Tabela.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.marshal(this.relatorio.getTabelas(), System.out);
w = new FileWriter(pathOpen);
m.marshal(this.relatorio.getTabelas(), w);
} catch (JAXBException ex) {
Logger.getLogger(FormPrincipal.class.getName()).log(Level.SEVERE, null, ex);
} catch(Exception e){
}finally {
try {
w.close();
} catch (Exception e) {
}
}
//e este é o erro
GRAVE: null
javax.xml.bind.JAXBException: class java.util.ArrayList nor any of its super class is known to this context.
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:554)
at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:470)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:314)
já n sei mais o qeu fazer
alguma luz nessa bagaça??
abrass