1 19 package org.netbeans.modules.xml.axi; 20 21 import org.netbeans.modules.xml.axi.visitor.AXIVisitor; 22 import org.netbeans.modules.xml.schema.model.GlobalAttributeGroup; 23 import org.netbeans.modules.xml.schema.model.GlobalComplexType; 24 import org.netbeans.modules.xml.schema.model.GlobalGroup; 25 import org.netbeans.modules.xml.schema.model.SchemaComponent; 26 27 34 public class ContentModel extends AXIContainer implements AXIType { 35 36 39 public static enum ContentModelType { 40 COMPLEX_TYPE, 41 GROUP, 42 ATTRIBUTE_GROUP 43 } 44 45 48 public ContentModel(AXIModel model, ContentModelType type) { 49 super(model); 50 this.type = type; 51 } 52 53 56 public ContentModel(AXIModel model, SchemaComponent schemaComponent) { 57 super(model, schemaComponent); 58 if(schemaComponent instanceof GlobalGroup) 59 type = ContentModelType.GROUP; 60 if(schemaComponent instanceof GlobalAttributeGroup) 61 type = ContentModelType.ATTRIBUTE_GROUP; 62 if(schemaComponent instanceof GlobalComplexType) 63 type = ContentModelType.COMPLEX_TYPE; 64 } 65 66 69 public void accept(AXIVisitor visitor) { 70 visitor.visit(this); 71 } 72 73 77 public ComponentType getComponentType() { 78 return ComponentType.SHARED; 79 } 80 81 84 public ContentModelType getType() { 85 return type; 86 } 87 88 public String toString() { 89 return getName(); 90 } 91 92 private ContentModelType type; 93 public static final String PROP_CONTENT_MODEL = "contentModel"; 94 } 95 | Popular Tags |