XStream处理既有属性又有值的xml节点


XML:

<node a="1">bcvvvvvv</node>


Bean:

@XStreamAlias("node")

@XStreamConverter(value=ToAtrributedValueConverter.class,strings={"content"})

public static class node{
@XStreamAsAttribtue

private String a;

private String content;

public node(String a,

                String content){

    this.a=a;

this.content=content
}

}



http://xstream.codehaus.org/annotations-tutorial.html#FieldAsText


你可能感兴趣的:(xstream)