📄 tagelement.java
字号:
/*
* 创建日期 2005-4-27
* 作 者 liug
*/
package com.icbc.util;
import java.util.Vector;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.icbc.core.Externalizable;
/**
* @author liug
* @time 16:20:47
*/
public class TagElement implements Externalizable {
// private Hashtable hTags = new Hashtable(5);
private DataCollection input = null;
private DataCollection output = null;
private String name = null;
private String sql = null;
private String updateSql = null;
private Context context = null;
/*
* (非 Javadoc)
*
* @see com.icbc.core.Externalizable#getName()
*/
public String getName() {
return name;
}
/*
* (非 Javadoc)
*
* @see com.icbc.core.Externalizable#initializeFrom(org.w3c.dom.Node)
*/
public Object initializeFrom(Node aNode) throws Exception {
NamedNodeMap attrs = aNode.getAttributes();
try {
String name = attrs.getNamedItem("id").getNodeValue().trim();
setName(name);
} catch (Exception e) {
}
try {
String sql = attrs.getNamedItem("sql").getNodeValue().trim();
setSql(sql);
} catch (Exception e) {
}
try {
String updateSql = attrs.getNamedItem("updateSql").getNodeValue().trim();
setUpdateSql(updateSql);
} catch (Exception e) {
}
context = new Context(name);
context.setTagElement(this);
return this;
}
/**
* @param updateSql
*/
public void setUpdateSql(String updateSql) {
// TODO 自动生成方法存根
this.updateSql = updateSql;
}
public String getUpdateSql(){
return this.updateSql;
}
/*
* (非 Javadoc)
*
* @see com.icbc.core.Externalizable#addElement(com.icbc.core.Externalizable)
*/
public void addElement(Externalizable element) {
if (element instanceof TagElement) {
//hTags.put(element.getName(), element);
Context ctx = ((TagElement) element).getContext();
ctx.setParent(this.context);
this.context.addChild(ctx);
} else if (element instanceof DataCollection) {
String id = element.getName();
if (id.equalsIgnoreCase("input")) {
input = (DataCollection) element;
}
if (id.equalsIgnoreCase("output")) {
output = (DataCollection) element;
}
}
}
/**
* @param name
* 要设置的 name。
*/
public void setName(String name) {
this.name = name;
}
/**
* 判断aNode是否是数据节点org.w3c.dom.Node.ELEMENT_NODE Creation date: (2001-12-27
* 18:19:30)
*
* @return boolean
* @param aNode
* org.w3c.dom.Node
*/
public boolean isElementNode(Node aNode) {
if (aNode == null) {
return false;
}
if (aNode.getNodeType() == Node.ELEMENT_NODE) {
return true;
} else {
return false;
}
}
/**
* @return 返回 sql。
*/
public String getSql() {
return sql;
}
/**
* @param sql
* 要设置的 sql。
*/
public void setSql(String sql) {
this.sql = sql;
}
/**
* @return 返回 context。
*/
public Context getContext() {
return context;
}
/**
* @return 返回 input。
*/
public Vector getInput() {
return input.getFields();
}
/**
* @return 返回 output。
*/
public Vector getOutput() {
return output.getFields();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -