Prezados,
estou com alguns objetos para sererm convertidos para XML e estou tomando o seguinte erro:
com.thoughtworks.xstream.core.AbstractReferenceMarshaller$ReferencedImplicitElementException: Cannot reference implicit element
---- Debugging information ----
implicit-element : [br.gov.inca.rbtmo.render.object.Grupo@1c4a198, br.gov.inca.rbtmo.render.object.Grupo@2d09e0, br.gov.inca.rbtmo.render.object.Grupo@99ff91, br.gov.inca.rbtmo.render.object.Grupo@165e55e, br.gov.inca.rbtmo.render.object.Grupo@856447, br.gov.inca.rbtmo.render.object.Grupo@17a7de4, br.gov.inca.rbtmo.render.object.Grupo@117b450]
referencing-element : /formulario/pagina/grupo[2]/grupo[2]
-------------------------------
sendo que a classe que está causando o erro é a seguinte:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package br.gov.inca.rbtmo.render.object;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import br.gov.inca.rbtmo.domain.facades.RBTMO;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
/**
*
* @author filipe
*/
@XStreamAlias("grupo")
public class Grupo extends HTMLElement implements Cloneable, Serializable {
@XStreamImplicit
private List<Titulo> titulo = new ArrayList<Titulo>();
@XStreamImplicit
private List<Label> labels = new ArrayList<Label>();
@XStreamImplicit
private List<Pergunta> perguntas = new ArrayList<Pergunta>();
@XStreamImplicit
private List<Link> links = new ArrayList<Link>();
@XStreamImplicit
private List<Grupo> groups = new ArrayList<Grupo>();
@XStreamImplicit
private List<Imagem> imagens = new ArrayList<Imagem>();
@XStreamImplicit
private List<Botao> botoes = new ArrayList<Botao>();
@XStreamAlias("tipo-instancia")
@XStreamAsAttribute
private Long tipoInstancia;
@XStreamAlias("instancia")
@XStreamAsAttribute
private Long instancia;
public List<Titulo> getTitulo() {
return titulo;
}
public void setTitulo(List<Titulo> titulo) {
this.titulo = titulo;
}
public List<Label> getLabels() {
return labels;
}
public void setLabels(List<Label> labels) {
this.labels = labels;
}
public List<Grupo> getGroups() {
return groups;
}
public void setGroups(List<Grupo> groups) {
this.groups = groups;
}
public List<Pergunta> getPerguntas() {
return perguntas;
}
public void setPerguntas(List<Pergunta> perguntas) {
this.perguntas = perguntas;
}
public List<Link> getLinks() {
return links;
}
public void setLinks(List<Link> links) {
this.links = links;
}
public List<Imagem> getImagens() {
return imagens;
}
public void setImagens(List<Imagem> imagens) {
this.imagens = imagens;
}
public List<Botao> getBotoes() {
return botoes;
}
public void setBotoes(List<Botao> botoes) {
this.botoes = botoes;
}
public Long getTipoInstancia() {
return tipoInstancia;
}
public void setTipoInstancia(Long tipoInstancia) {
this.tipoInstancia = tipoInstancia;
}
public Long getInstancia() {
return instancia;
}
public void setInstancia(Long instancia) {
this.instancia = instancia;
}
public void carregarRepostas(Formulario formulario) {
//verificando se o grupo é de instancia, caso seja serão instanciados
//grupos a partir das respostas
if (this.tipoInstancia != null && !this.tipoInstancia.equals("")) {
this.montarInstancias(formulario);
} else {
if (this.perguntas != null && !this.perguntas.isEmpty()) {
for (Pergunta pergunta : this.perguntas) {
pergunta.carregarRepostas(formulario);
}
}
if (this.groups != null && !this.groups.isEmpty()) {
for (Grupo grupo : this.groups) {
grupo.carregarRepostas(formulario);
}
}
}
}
public void excluirRepostas(Long idFormulario) {
if (this.perguntas != null && !this.perguntas.isEmpty()) {
for (Pergunta pergunta : this.perguntas) {
pergunta.excluirRepostas(idFormulario);
}
}
if (this.groups != null && !this.groups.isEmpty()) {
for (Grupo gr : this.groups) {
gr.excluirRepostas(idFormulario);
}
}
}
public void montarInstancias(Formulario formulario) {
try {
Grupo padrao = null;
for (Grupo inst : this.groups) {
if (inst.instancia != null && !inst.instancia.equals("")) {
padrao = inst;
break;
}
}
Long qtInstancia = RBTMO.buscarQuantidadeInstancias(formulario.getId(), this.tipoInstancia);
if (qtInstancia > 0) {
List<Grupo> gruposInstancia = new ArrayList<Grupo>();
for (int i = 0; i < qtInstancia; i++) {
Grupo grupoInstancia = (Grupo) padrao.clone();
grupoInstancia.setInstancia(new Long(i + 1));
//não incluir o botão de excluir na primeira instancia
if (i != 0) {
// incluindo os botões de exclusão nos grupos
Grupo grupoBtnExcluir = new Grupo();
Botao botao = new Botao();
botao.setValue("Excluir");
botao.setOnclick("removerInstancia(this)");
if (grupoBtnExcluir == null) {
grupoBtnExcluir.setBotoes(new ArrayList<Botao>());
}
grupoBtnExcluir.getBotoes().add(botao);
if(grupoInstancia.getGroups()== null){
grupoInstancia.setGroups(new ArrayList<Grupo>());
}
grupoInstancia.getGroups().add(grupoBtnExcluir);
}
gruposInstancia.add(grupoInstancia);
}
this.groups = gruposInstancia;
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
alguém já tomou este tipo de erro de conversão do XStream?
desde já eu agradeço.