1 19 20 package org.netbeans.modules.xml.schema.model.impl; 21 22 import java.io.IOException ; 23 import org.netbeans.modules.xml.schema.model.Documentation; 24 import org.netbeans.modules.xml.schema.model.SchemaComponent; 25 import org.netbeans.modules.xml.schema.model.visitor.SchemaVisitor; 26 import org.w3c.dom.Element ; 27 31 public class DocumentationImpl extends SchemaComponentImpl implements Documentation { 32 33 public DocumentationImpl(SchemaModelImpl model) { 34 this(model,createNewComponent(SchemaElements.DOCUMENTATION,model)); 35 } 36 37 40 public DocumentationImpl(SchemaModelImpl model, Element el) { 41 super(model, el); 42 } 43 44 48 public Class <? extends SchemaComponent> getComponentType() { 49 return Documentation.class; 50 } 51 52 55 public void setLanguage(String lang) { 56 setAttribute(LANGUAGE_PROPERTY, SchemaAttributes.LANGUAGE, lang); 57 } 58 59 62 public void accept(SchemaVisitor visitor) { 63 visitor.visit(this); 64 } 65 66 69 public void setSource(String uri) { 70 setAttribute(SOURCE_PROPERTY, SchemaAttributes.SOURCE, uri); 71 } 72 73 76 public String getSource() { 77 return getAttribute(SchemaAttributes.SOURCE); 78 } 79 80 83 public String getLanguage() { 84 return getAttribute(SchemaAttributes.LANGUAGE); 85 } 86 87 public void setDocumentationElement(Element content) { 88 super.updatePeer(CONTENT_PROPERTY, content); 89 } 90 91 public Element getDocumentationElement() { 92 return Element .class.cast(getPeer().cloneNode(true)); 93 } 94 95 public void setContent(String content) { 96 setText(CONTENT_PROPERTY, content); 97 } 98 99 public String getContent() { 100 return getText(); 101 } 102 103 public void setContentFragment(String text) throws IOException { 104 super.setXmlFragment(CONTENT_PROPERTY, text); 105 } 106 107 public String getContentFragment() { 108 return super.getXmlFragment(); 109 } 110 } 111 | Popular Tags |