1 7 8 package org.jdesktop.jdnc.markup.elem; 9 10 import java.util.ArrayList ; 11 import java.util.Hashtable ; 12 import java.util.List ; 13 import java.util.Map ; 14 15 import net.openmarkup.ElementAssimilator; 16 import net.openmarkup.ElementHandler; 17 import net.openmarkup.ElementType; 18 import net.openmarkup.Realizable; 19 20 import org.w3c.dom.Element ; 21 import org.w3c.dom.Node ; 22 import org.w3c.dom.NodeList ; 23 24 import org.jdesktop.jdnc.markup.ElementTypes; 25 import org.jdesktop.jdnc.markup.Namespace; 26 27 30 public class DataFieldEnumerationElement extends ElementProxy { 31 private static final Map elementMap = new Hashtable (); 32 33 public DataFieldEnumerationElement(Element element, ElementType elementType) { 34 super(element, elementType); 35 } 36 37 public Object instantiate() { 38 return new ArrayList (); 39 } 40 41 protected Map registerElementHandlers() { 42 Map handlerMap = super.registerElementHandlers(); 43 if (handlerMap != null) { 44 handlerMap.put(Namespace.JDNC + ":" + 45 ElementTypes.FIELD_META_DATA_ENUMERATION.getLocalName(), 46 enumerationValueElementHandler); 47 } 48 return handlerMap; 49 } 50 51 protected Map getElementHandlerMap() { 52 return elementMap; 53 } 54 55 public static final ElementAssimilator dataEnumerationValueAssimilator = new ElementAssimilator() { 56 public void assimilate(Realizable parent, Realizable child) { 57 List list = (List )parent.getObject(); 58 list.add(child.getObject()); 59 } 60 }; 61 62 private static final ElementHandler enumerationValueElementHandler = 63 new ElementHandler(ElementTypes.FIELD_META_DATA_ENUMERATION, 64 dataEnumerationValueAssimilator); 65 66 } 67 | Popular Tags |