1 7 8 package org.jdesktop.jdnc.markup.elem; 9 10 import java.util.Hashtable ; 11 import java.util.Map ; 12 13 import net.openmarkup.AttributeHandler; 14 import net.openmarkup.ElementAssimilator; 15 import net.openmarkup.ElementHandler; 16 import net.openmarkup.ElementType; 17 import net.openmarkup.Realizable; 18 19 import org.w3c.dom.Element ; 20 21 import org.jdesktop.jdnc.markup.Attributes; 22 import org.jdesktop.jdnc.markup.ElementTypes; 23 import org.jdesktop.jdnc.markup.Namespace; 24 import org.jdesktop.jdnc.markup.attr.HierarchicalDataAttributes; 25 26 30 public class HierarchicalDataElement extends ElementProxy { 31 private static final Map attrMap = new Hashtable (); 32 private static final Map elementMap = new Hashtable (); 33 private static final Map mediaTypeRepresentation = new Hashtable (); 34 35 public HierarchicalDataElement(Element element, ElementType elementType) { 36 super(element, elementType); 37 } 38 39 protected void applyAttributesAfter() { 40 super.applyAttributesAfter(); 41 applyAttribute(Namespace.JDNC, Attributes.SOURCE); 42 } 43 44 protected Map registerAttributeHandlers() { 45 Map handlerMap = super.registerAttributeHandlers(); 46 if (handlerMap != null) { 47 handlerMap.put(Namespace.JDNC + ":" + Attributes.SOURCE, sourceHandler); 48 } 49 return handlerMap; 50 } 51 52 protected Map registerElementHandlers() { 53 Map handlerMap = super.registerElementHandlers(); 54 if (handlerMap != null) { 55 handlerMap.put(Namespace.JDNC + ":" + 56 ElementTypes.META_DATA.getLocalName(), 57 metaDataElementHandler); 58 } 59 return handlerMap; 60 } 61 62 public static final ElementAssimilator metaDataAssimilator = new 63 ElementAssimilator() { 64 public void assimilate(Realizable parent, Realizable child) { 65 66 } 67 }; 68 69 protected Map getAttributeHandlerMap() { 70 return attrMap; 71 } 72 73 protected Map getElementHandlerMap() { 74 return elementMap; 75 } 76 77 78 private static final AttributeHandler sourceHandler = 79 new AttributeHandler(Namespace.JDNC, Attributes.SOURCE, HierarchicalDataAttributes.sourceApplier); 80 81 private static final ElementHandler metaDataElementHandler = 82 new ElementHandler(ElementTypes.META_DATA, metaDataAssimilator); 83 84 } 85 | Popular Tags |