1 19 package org.netbeans.modules.xml.xsd; 20 21 25 class Namespace { 26 27 public static final String XMLNS_ATTR = "xmlns"; public static final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance"; public static final String XSI_LOCATION = "schemaLocation"; public static final String XSI_NO_NAMESPACE_LOCATION = "noNamespaceSchemaLocation"; public static final String XSD_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema"; 33 34 private final String uri; 35 36 private final String prefix; 37 38 private String schemaLocation; 39 40 private XSDGrammar grammar; 41 42 43 public Namespace(String uri, String prefix) { 44 this.uri = uri; 45 this.prefix = prefix; 46 this.schemaLocation = null; 47 this.grammar = null; 48 } 49 50 54 public java.lang.String getURI() { 55 return uri; 56 } 57 58 62 public java.lang.String getPrefix() { 63 return prefix; 64 } 65 66 public void setSchemaLocation(String location) { 67 this.schemaLocation = location; 68 } 69 70 public String getSchemaLocation() { 71 return schemaLocation; 72 } 73 74 78 public org.netbeans.modules.xml.xsd.XSDGrammar getGrammar() { 79 return grammar; 80 } 81 82 86 public void setGrammar(org.netbeans.modules.xml.xsd.XSDGrammar grammar) { 87 this.grammar = grammar; 88 } 89 90 91 public static String getPrefix(String name) { 92 int i = name.indexOf(':'); 93 if (i >= 0) { 94 return name.substring(0, i); 95 } 96 97 return null; 98 } 99 100 101 public static String getSufix(String name) { 102 int i = name.indexOf(':'); 103 if (i >= 0) { 104 return name.substring(i + 1); 105 } 106 107 return null; 108 } 109 110 } 111 | Popular Tags |