1 23 24 package org.enhydra.xml.xmlc.metadata; 25 26 import java.util.ArrayList ; 27 28 31 abstract class HTMLTagSetDef { 32 35 private ArrayList tagDefs = new ArrayList (); 36 private ArrayList attrDefs = new ArrayList (); 37 38 41 private boolean readOnly = false; 42 43 46 private void modifyCheck() { 47 if (readOnly) { 48 throw new UnsupportedOperationException ("HTMLTagSetDef object is read-only"); 49 } 50 } 51 52 55 protected void addTagDef(HTMLTagDef tagDef) { 56 modifyCheck(); 57 tagDefs.add(tagDef); 58 } 59 60 63 protected void addAttrDef(HTMLAttrDef attrDef) { 64 modifyCheck(); 65 attrDefs.add(attrDef); 66 } 67 70 protected void setReadOnly() { 71 readOnly = true; 72 } 73 74 77 public HTMLTagDef[] getTagDefs() { 78 return (HTMLTagDef[])tagDefs.toArray(new HTMLTagDef[tagDefs.size()]); 79 } 80 81 84 public HTMLAttrDef[] getAttrDefs() { 85 return (HTMLAttrDef[])attrDefs.toArray(new HTMLAttrDef[attrDefs.size()]); 86 } 87 } 88 | Popular Tags |