You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.6 KiB
58 lines
1.6 KiB
package com.fr.plugin.tabledata.attr; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
import com.fr.plugin.transform.ExecuteFunctionRecord; |
|
import com.fr.plugin.transform.FunctionRecorder; |
|
import com.fr.stable.StringUtils; |
|
import com.fr.stable.fun.impl.AbstractTableDataAttrMark; |
|
import com.fr.stable.xml.XMLPrintWriter; |
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
/** |
|
* @author rinoux |
|
* @version 10.0 |
|
* Created by rinoux on 2020/11/2 |
|
*/ |
|
@FunctionRecorder |
|
public class DemoTDXtraConfig extends AbstractTableDataAttrMark { |
|
|
|
public static final String XML_TAG = "DemoTDXtraConfig"; |
|
public static final String ATTR_MARK_TAG = "DemoTDXtraConfigAttr"; |
|
|
|
|
|
private String demoAttr = "this is a tabledata extra attr demo"; |
|
|
|
|
|
@ExecuteFunctionRecord |
|
public String getDemoAttr() { |
|
return demoAttr; |
|
} |
|
|
|
public void setDemoAttr(String demoAttr) { |
|
this.demoAttr = demoAttr; |
|
} |
|
|
|
@Override |
|
public String attrMarkTag() { |
|
return ATTR_MARK_TAG; |
|
} |
|
|
|
@Override |
|
public void readXML(XMLableReader reader) { |
|
if (reader.isChildNode()) { |
|
String tagName = reader.getTagName(); |
|
if (XML_TAG.equals(tagName)) { |
|
this.demoAttr = reader.getAttrAsString("demoAttr", StringUtils.EMPTY); |
|
FineLoggerFactory.getLogger().info("demoAttr is found as value {}", this.demoAttr); |
|
} |
|
} |
|
} |
|
|
|
@Override |
|
public void writeXML(XMLPrintWriter writer) { |
|
XMLPrintWriter configTag = writer.startTAG(XML_TAG); |
|
|
|
configTag.attr("demoAttr", this.demoAttr); |
|
configTag.end(); |
|
} |
|
}
|
|
|