📄 i_attributetransformer.java
字号:
/*------------------------------------------------------------------------------Name: I_AttributeTransformer.javaProject: org.xmlBlasterProject: xmlBlaster.orgCopyright: xmlBlaster.org, see xmlBlaster-LICENSE file------------------------------------------------------------------------------*/package org.xmlBlaster.contrib.dbwatcher.convert;import java.util.Map;import java.sql.ResultSet;import org.xmlBlaster.contrib.I_Info;/** * Supports adding of customized attributes (key/values) to the xml dump. * <p> * Example: * </p> * <pre><?xml version='1.0' encoding='UTF-8' ?><sql> <desc> <command>INSERT</command> <ident>AFTN_CIRCUIT_STATE</ident> <colname type='DATE' nullable='0'>DATUM</colname> <colname type='NUMBER' precision='11' nullable='0'>CPU</colname> </desc> <row num='0'> <col name='DATUM'>2005-01-05 15:41:36.0</col> <col name='CPU'>238089</col> <font color="red"><attr name='SUBNET_ID'>TCP</attr> <attr name='CIRCUIT'>AAAAAAAAAAAAAAAZ</attr> <attr name='CIRCUIT_STATE'>OPERATIVE</attr></font> </row></sql> * </pre> * <p> * The above <tt>attr</tt> tags are created by all <tt>Map</tt> entries * returned with the {@link #transform(ResultSet rs, int rowCount)} method. * It is up to your plugin to create arbitrary map entries which you want * to add. * </p> * * @author Marcel Ruff */public interface I_AttributeTransformer { /** * Is called after construction. * @param info The configuration environment * @throws Exception */ void init(I_Info info) throws Exception; /** * Customized transformation to key/values from a given JDBC result set. * <p> * This is called from <tt>I_DataConverter</tt> for each row instance 'rs', * you may not call <tt>rs.next()</tt>. * </p> * @param rs The SQL result * @param rowCount -1 when called for the <tt><desc></tt> section else * it is the current row count of the ResultSet beginning with 0 * @return If not null your attributes are added to the XML dump, * if null no attributes are added * @throws Exception if the plugin desires so */ Map transform(ResultSet rs, int rowCount) throws Exception; /** * Cleanup resources. * @throws Exception */ void shutdown() throws Exception;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -