1 19 20 package org.netbeans.modules.xml.schema.model.impl; 21 22 import org.netbeans.modules.xml.schema.model.Include; 23 import org.netbeans.modules.xml.schema.model.SchemaComponent; 24 import org.netbeans.modules.xml.schema.model.SchemaModel; 25 import org.netbeans.modules.xml.schema.model.SchemaModelFactory; 26 import org.netbeans.modules.xml.schema.model.visitor.SchemaVisitor; 27 import org.netbeans.modules.xml.xam.Model; 28 import org.netbeans.modules.xml.xam.locator.CatalogModelException; 29 import org.netbeans.modules.xml.xam.ModelSource; 30 import org.openide.util.NbBundle; 31 import org.w3c.dom.Element ; 32 33 37 public class IncludeImpl extends SchemaComponentImpl implements Include{ 38 39 protected IncludeImpl(SchemaModelImpl model){ 40 this(model, createNewComponent(SchemaElements.INCLUDE, model)); 41 } 42 43 public IncludeImpl(SchemaModelImpl model, Element el){ 44 super(model,el); 45 } 46 47 51 public Class <? extends SchemaComponent> getComponentType() { 52 return Include.class; 53 } 54 55 58 public void accept(SchemaVisitor visitor) { 59 visitor.visit(this); 60 } 61 62 65 public void setSchemaLocation(String uri) { 66 setAttribute(SCHEMA_LOCATION_PROPERTY, SchemaAttributes.SCHEMA_LOCATION, uri); 67 } 68 69 72 public String getSchemaLocation() { 73 return getAttribute(SchemaAttributes.SCHEMA_LOCATION); 74 } 75 76 public SchemaModel resolveReferencedModel() throws CatalogModelException { 77 ModelSource ms = resolveModel(getSchemaLocation()); 78 return SchemaModelFactory.getDefault().getModel(ms); 79 } 80 } 81 | Popular Tags |