1 19 20 package org.netbeans.modules.xml.schema.model.impl; 21 import org.netbeans.modules.xml.schema.model.BoundaryFacet; 22 import org.w3c.dom.Element ; 23 24 29 public abstract class BoundaryElement extends SchemaComponentImpl implements BoundaryFacet { 30 31 32 public BoundaryElement(SchemaModelImpl model, Element e) { 33 super(model, e); 34 } 35 36 public abstract String getComponentName(); 37 38 public void setValue(String v) { 39 setAttribute(VALUE_PROPERTY, SchemaAttributes.VALUE, v); 40 } 41 42 public String getValue() { 43 String v = super.getAttribute(SchemaAttributes.VALUE); 44 if (v == null) { 45 throw new IllegalArgumentException ("Element '" + getComponentName() + "' got null value."); 46 } 47 return v; 48 } 49 50 public Boolean isFixed() { 51 String s = getAttribute(SchemaAttributes.FIXED); 52 return s == null ? null : Boolean.valueOf(s); 53 } 54 55 public void setFixed(Boolean isFixed) { 56 setAttribute(FIXED_PROPERTY, SchemaAttributes.FIXED, isFixed); 57 } 58 59 public boolean getFixedDefault() { 60 return false; 61 } 62 63 public boolean getFixedEffective() { 64 Boolean v = isFixed(); 65 return v == null ? getFixedDefault() : v; 66 } 67 } 68 | Popular Tags |