XStream處理既有屬性又有值的xml節點


XML: html

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


Bean: node

@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 this

相關文章
相關標籤/搜索