1 19 package org.netbeans.modules.xml.axi; 20 21 import java.util.List ; 22 import org.netbeans.modules.xml.axi.visitor.AXIVisitor; 23 import org.netbeans.modules.xml.schema.model.SchemaComponent; 24 25 30 public abstract class AbstractElement extends AXIContainer { 31 32 35 public AbstractElement(AXIModel model) { 36 super(model); 37 } 38 39 42 public AbstractElement(AXIModel model, SchemaComponent schemaComponent) { 43 super(model, schemaComponent); 44 } 45 46 49 public AbstractElement(AXIModel model, AXIComponent sharedComponent) { 50 super(model, sharedComponent); 51 } 52 53 56 public abstract void accept(AXIVisitor visitor); 57 58 61 public String getMinOccurs() { 62 return minOccurs; 63 } 64 65 68 public void setMinOccurs(String value) { 69 String oldValue = getMinOccurs(); 70 if( (oldValue == null && value == null) || 71 (oldValue != null && oldValue.equals(value)) ) { 72 return; 73 } 74 this.minOccurs = value; 75 firePropertyChangeEvent(PROP_MINOCCURS, oldValue, value); 76 } 77 78 81 public String getMaxOccurs() { 82 return maxOccurs; 83 } 84 85 88 public void setMaxOccurs(String value) { 89 String oldValue = getMaxOccurs(); 90 if( (oldValue == null && value == null) || 91 (oldValue != null && oldValue.equals(value)) ) { 92 return; 93 } 94 this.maxOccurs = value; 95 firePropertyChangeEvent(PROP_MAXOCCURS, oldValue, value); 96 } 97 98 103 public boolean allowsFullMultiplicity() { 104 return !(getParent() instanceof Compositor && 105 ((Compositor)getParent()).getType() == Compositor.CompositorType.ALL); 106 } 107 108 protected String minOccurs = "1"; 109 protected String maxOccurs = "1"; 110 111 public static final String PROP_MINOCCURS = "minOccurs"; public static final String PROP_MAXOCCURS = "maxOccurs"; public static final String PROP_ELEMENT = "element"; } 115 | Popular Tags |