1 23 24 package org.enhydra.xml.xmlc.metadata; 25 26 import org.w3c.dom.Document ; 27 28 32 public class ElementDef extends MetaDataElement { 33 36 public static final String TAG_NAME = "elementDef"; 37 38 41 private static final String ELEMENT_ID_ATTR = "elementId"; 42 private static final String TAG_NAMES_ATTR = "tagNames"; 43 private static final String DOM_TYPE_ATTR = "domType"; 44 private static final String JAVA_NAME_ATTR = "javaName"; 45 private static final String CREATE_SETTEXT_ATTR = "createSetText"; 46 private static final String CREATE_GETELEMENT_ATTR = "createGetElement"; 47 private static final String OPTIONAL_ATTR = "optional"; 48 49 52 public ElementDef(Document ownerDoc) { 53 super(ownerDoc, TAG_NAME); 54 } 55 56 59 public String getElementId() { 60 return getAttributeNull(ELEMENT_ID_ATTR); 61 } 62 63 66 public void setElementId(String value) { 67 setRemoveAttribute(ELEMENT_ID_ATTR, value); 68 } 69 70 73 public String [] getTagNames() { 74 return getStringArrayAttribute(TAG_NAMES_ATTR); 75 } 76 77 80 public void setTagNames(String [] values) { 81 setRemoveStringArrayAttribute(TAG_NAMES_ATTR, values); 82 } 83 84 87 public String getDomType() { 88 return getAttributeNull(DOM_TYPE_ATTR); 89 } 90 91 94 public void setDomType(String value) { 95 setRemoveAttribute(DOM_TYPE_ATTR, value); 96 } 97 98 101 public String getJavaName() { 102 return getAttributeNull(JAVA_NAME_ATTR); 103 } 104 105 108 public void setJavaName(String value) { 109 setRemoveAttribute(JAVA_NAME_ATTR, value); 110 } 111 112 115 public Boolean getCreateSetText() { 116 return getBooleanObjectAttribute(CREATE_SETTEXT_ATTR); 117 } 118 119 122 public void setCreateSetText(Boolean value) { 123 setBooleanObjectAttribute(CREATE_SETTEXT_ATTR, value); 124 } 125 126 129 public Boolean getCreateGetElement() { 130 return getBooleanObjectAttribute(CREATE_GETELEMENT_ATTR); 131 } 132 133 136 public void setCreateGetElement(Boolean value) { 137 setBooleanObjectAttribute(CREATE_GETELEMENT_ATTR, value); 138 } 139 140 143 public boolean getOptional() { 144 return getBooleanAttribute(OPTIONAL_ATTR); 145 } 146 147 150 public void setOptional(boolean value) { 151 setBooleanAttribute(OPTIONAL_ATTR, value); 152 } 153 154 157 public ElementDef[] getElementDef() { 158 return (ElementDef[])getChildren(ElementDef.class); 159 } 160 161 164 public void addElementDef(ElementDef elementDef) { 165 appendChild(elementDef); 166 } 167 168 171 public void deleteElementDef(ElementDef elementDef) { 172 removeChild(elementDef); 173 } 174 } 175 | Popular Tags |