public java.lang.String toString() {
java.lang.StringBuilder builder = new java.lang.StringBuilder();
java.util.Map<String,String> map =null;
builder.append("<style>");
builder.append("body{background: aliceblue;}");
builder.append("#my{font-size: 25px;margin: 25px;}");
builder.append("h5{margin: 5px;}");
builder.append("xmp{display: inline;}");
builder.append("#value{color: green;font-weight: bold;font-size: 30px;}");
builder.append("</style>");

builder.append("<div id=\"my\"><h5>$classname{</h5>");
#foreach ($member in $members)
    #if ($member.map)
    builder.append("<h5>$member.name{</h5>");
        map = $member.accessor;
        if(map != null && map.size() >0){
            for(String key : map.keySet()){
        builder.append("&emsp;<span id=\"key\">"+key+"=</span><span id=\"value\"><xmp>"+map.get(key)+"</xmp></span><br>");
            }
        }else{
        builder.append("&emsp;Null");
        }
    builder.append("<h5>}</h5>");
    #else
        builder.append("<span id=\"key\">$member.name=</span><span id=\"value\"><xmp>"+$member.accessor+"</xmp></span><br>");
    #end
#end
builder.append("<h5>}</h5>");
return builder.toString();
}
Last modification:November 21st, 2020 at 01:09 pm
如果觉得我的文章对你有用,请随意赞赏