1 19 20 package org.netbeans.modules.websvc.wsdl; 21 22 import java.beans.PropertyChangeListener ; 23 import java.io.IOException ; 24 import java.util.ArrayList ; 25 import java.util.Iterator ; 26 import java.util.List ; 27 28 import org.xml.sax.EntityResolver ; 29 import org.xml.sax.InputSource ; 30 import org.xml.sax.SAXException ; 31 32 import org.openide.util.NbBundle; 33 import org.openide.util.Utilities; 34 35 import org.netbeans.modules.xml.catalog.spi.CatalogReader; 36 import org.netbeans.modules.xml.catalog.spi.CatalogDescriptor; 37 import org.netbeans.modules.xml.catalog.spi.CatalogListener; 38 39 47 public class WSSchemaCatalog implements CatalogReader, CatalogDescriptor, EntityResolver { 48 49 public static final String JAXRPC_CONFIG_1_1 = "http://java.sun.com/xml/ns/jax-rpc/ri/config"; public static final String JAXRPC_CONFIG_1_1_SLASH = "http://java.sun.com/xml/ns/jax-rpc/ri/config/"; private static final String JAXRPC_CONFIG_1_1_XSD = "jax-rpc-ri-config_1_1.xsd"; private static final String URL_JAXRPC_CONFIG_1_1 = "nbres:/org/netbeans/modules/websvc/wsdl/config/resources/jax-rpc-ri-config_1_1.xsd"; private static final String URL_JAXRPC_CONFIG_1_1_DTD = "nbres:/org/netbeans/modules/websvc/wsdl/config/resources/jax-rpc-ri-config_1_1.dtd"; 55 public static final String JAXRPC_CONFIG_1_1_ID = "SCHEMA:" + JAXRPC_CONFIG_1_1; 57 public WSSchemaCatalog() { 58 } 59 60 64 public Iterator <String > getPublicIDs() { 65 List <String > list = new ArrayList <String >(); 66 list.add(JAXRPC_CONFIG_1_1_ID); 67 return list.listIterator(); 68 } 69 70 74 public String getSystemID(String publicId) { 75 if(JAXRPC_CONFIG_1_1_ID.equals(publicId)) { 76 return URL_JAXRPC_CONFIG_1_1_DTD; 77 } else { 78 return null; 79 } 80 } 81 82 85 public void refresh() { 86 } 87 88 92 public void addCatalogListener(CatalogListener l) { 93 } 94 95 99 public void removeCatalogListener(CatalogListener l) { 100 } 101 102 103 public void addPropertyChangeListener(PropertyChangeListener l) { 104 } 105 106 109 public String getDisplayName() { 110 return NbBundle.getMessage(WSSchemaCatalog.class, "LBL_WebServiceSchemaCatalog"); } 112 113 118 public java.awt.Image getIcon(int type) { 119 return Utilities.loadImage("org/netbeans/modules/websvc/wsdl/resources/WebServiceSchemaCatalog.png"); } 121 122 125 public String getShortDescription() { 126 return NbBundle.getMessage (WSSchemaCatalog.class, "DESC_WebServiceSchemaCatalog"); 127 } 128 129 131 public void removePropertyChangeListener(PropertyChangeListener l) { 132 } 133 134 140 public InputSource resolveEntity(String publicId, String systemId) throws SAXException , IOException { 141 if(JAXRPC_CONFIG_1_1.equals(systemId) || JAXRPC_CONFIG_1_1_SLASH.equals(systemId)) { 142 return new InputSource (URL_JAXRPC_CONFIG_1_1); 143 } else if(systemId != null && systemId.endsWith(JAXRPC_CONFIG_1_1_XSD)) { 144 return new org.xml.sax.InputSource (URL_JAXRPC_CONFIG_1_1); 145 } else { 146 return null; 147 } 148 } 149 150 154 public String resolveURI(String name) { 155 if(JAXRPC_CONFIG_1_1.equals(name) || JAXRPC_CONFIG_1_1_SLASH.equals(name)) { 156 return URL_JAXRPC_CONFIG_1_1; 157 } 158 159 return null; 160 } 161 165 public String resolvePublic(String publicId) { 166 return null; 167 } 168 } 169 | Popular Tags |