📄 hibernateelementattributes.java
字号:
package com.tanghan.plugin.hibernate.editor.elements;import java.util.ArrayList;import java.util.List;import java.util.Properties;import org.w3c.dom.Element;/** * @author Jerry Tang * @version v0.1.0 * @copyright (C) 2003 Tanghan Studio */public class HibernateElementAttributes { /**当前元素没有属性*/ public static final List EmptyAttributes = new ArrayList(0); /**当前元素*/ Element element; /**当前元素的当前所有属性*/ Properties currentAttributes; /**当前元素所有合法属性*/ List allAttributes; /**当前元素所有合法属性*/ List allChildElement; public HibernateElementAttributes(){ } public HibernateElementAttributes(Element element){ this.element = element; } private void initCurrentAttributes(){ if(currentAttributes==null){ currentAttributes = new Properties(); } } private void initAllAttributes(){ if(allAttributes==null){ allAttributes = new ArrayList(4); } } private void initAllChildElement(){ if(allChildElement==null){ allChildElement = new ArrayList(4); } } /** * @return */ public List getAllAttributes() { if(allAttributes==null) return EmptyAttributes; return allAttributes; } /** * @return */ public Properties getCurrentAttributes() { initCurrentAttributes(); return currentAttributes; } /** * @return */ public Element getElement() { return element; } /** * @param list */ public void setAllAttributes(List list) { allAttributes = list; } /** * @param properties */ public void setCurrentAttributes(Properties properties) { currentAttributes = properties; } /** * @param properties */ public void addCurrentAttributes(Object key , Object value) { initCurrentAttributes(); currentAttributes.put(key,value); } /** * @param properties */ public void addAttribute(ElementAttribute elemAttribute) { initAllAttributes(); allAttributes.add(elemAttribute); } /** * @param element */ public void setElement(Element element) { this.element = element; } /** * @return */ public List getAllChildElement() { if(allChildElement==null) return EmptyAttributes; return allChildElement; } /** * @param list */ public void setAllChildElement(List list) { allChildElement = list; } /** * @param properties */ public void addChildElement(String childElement) { this.initAllChildElement(); allChildElement.add(childElement); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -