/** * If namespace handler's schema imports other schemas from cxf-core bundle, this method * may be used to delegate to <code>CXFAPINamespaceHandler</code> to resolve imported schema. * @param namespace * @return if namespace may be resolved by CXFAPINamespaceHandler valid URL is returned. Otherwise * returns <code>null</code> */ protected URL findCoreSchemaLocation(String namespace) { return cxfApiNamespaceHandler.getSchemaLocation(namespace); }
/** * If namespace handler's schema imports other schemas from cxf-core bundle, this method * may be used to delegate to <code>CXFAPINamespaceHandler</code> to resolve imported schema. * @param namespace * @return if namespace may be resolved by CXFAPINamespaceHandler valid URL is returned. Otherwise * returns <code>null</code> */ protected URL findCoreSchemaLocation(String namespace) { return cxfApiNamespaceHandler.getSchemaLocation(namespace); }
@Override public URL getSchemaLocation(String s) { URL url = handler.getSchemaLocation(s); if (url != null && url.equals(res)) { Boolean v, newValue; Boolean valid = ((v = cache.get(s)) == null && (newValue = isValidSchema(s, url)) != null && (v = cache.putIfAbsent(s, newValue)) == null) ? newValue : v; return valid ? url : null; } return url; } @Override
@Override public URL getSchemaLocation(String s) { URL url = handler.getSchemaLocation(s); if (url != null && url.equals(res)) { Boolean v, newValue; Boolean valid = ((v = cache.get(s)) == null && (newValue = isValidSchema(s, url)) != null && (v = cache.putIfAbsent(s, newValue)) == null) ? newValue : v; return valid ? url : null; } return url; } @Override
public URL getSchemaLocation(String namespace) { if (isCmNamespace(namespace)) { String v = namespace.substring("http://aries.apache.org/blueprint/xmlns/blueprint-cm/v".length()); return getClass().getResource("blueprint-cm-" + v + ".xsd"); } else if (isExtNamespace(namespace)) { try { Class<?> extNsHandlerClazz; Bundle extBundle = FrameworkUtil.getBundle(PlaceholdersUtils.class); if (extBundle == null) { // we may not be in OSGi environment extNsHandlerClazz = getClass().getClassLoader().loadClass("org.apache.aries.blueprint.ext.impl.ExtNamespaceHandler"); } else { extNsHandlerClazz = extBundle.loadClass("org.apache.aries.blueprint.ext.impl.ExtNamespaceHandler"); } return ((NamespaceHandler) extNsHandlerClazz.newInstance()).getSchemaLocation(namespace); } catch (Throwable t) { LOGGER.warn("Could not locate ext namespace schema", t); return null; } } else { return null; } }
public URL getSchemaLocation(String namespace) { if (isCmNamespace(namespace)) { String v = namespace.substring("http://aries.apache.org/blueprint/xmlns/blueprint-cm/v".length()); return getClass().getResource("blueprint-cm-" + v + ".xsd"); } else if (isExtNamespace(namespace)) { try { Class<?> extNsHandlerClazz; Bundle extBundle = FrameworkUtil.getBundle(PlaceholdersUtils.class); if (extBundle == null) { // we may not be in OSGi environment extNsHandlerClazz = getClass().getClassLoader().loadClass("org.apache.aries.blueprint.ext.impl.ExtNamespaceHandler"); } else { extNsHandlerClazz = extBundle.loadClass("org.apache.aries.blueprint.ext.impl.ExtNamespaceHandler"); } return ((NamespaceHandler) extNsHandlerClazz.newInstance()).getSchemaLocation(namespace); } catch (Throwable t) { LOGGER.warn("Could not locate ext namespace schema", t); return null; } } else { return null; } }
URL result = null; try { result = handler.getSchemaLocation(""); } catch (Throwable t) {
URL result = null; try { result = handler.getSchemaLocation(""); } catch (Throwable t) {
protected NamespaceHandlerSet getNamespaceHandlerSetFromClassNames(ServletContext servletContext, ClassLoader tccl, List<String> handlerClassNames) { SimpleNamespaceHandlerSet nsSet = new SimpleNamespaceHandlerSet(); for (String name : handlerClassNames) { String trimmedName = name.trim(); Object instance = null; try { instance = tccl.loadClass(trimmedName).newInstance(); } catch (Exception ex) { throw new RuntimeException("Failed to load NamespaceHandler: " + trimmedName, ex); } if (!(instance instanceof NamespaceHandler)) { throw new RuntimeException("Invalid NamespaceHandler: " + trimmedName); } NamespaceHandler nsHandler = (NamespaceHandler)instance; Namespaces namespaces = nsHandler.getClass().getAnnotation(Namespaces.class); if (namespaces != null) { for (String ns : namespaces.value()) { nsSet.addNamespace(URI.create(ns), nsHandler.getSchemaLocation(ns), nsHandler); } } } return nsSet; }
URL url = handlers.get(ns).getSchemaLocation(ns.toString()); if (url == null && locations != null) { String loc = locations.get(ns.toString()); if (loc != null) { url = handlers.get(ns).getSchemaLocation(loc);
URL url = handlers.get(ns).getSchemaLocation(ns.toString()); if (url == null && locations != null) { String loc = locations.get(ns.toString()); if (loc != null) { url = handlers.get(ns).getSchemaLocation(loc);
URL url = h.getSchemaLocation(rid); if (isCorrectUrl(url)) { return createLSInput(url, id, namespaceURI); URL url = hd.getSchemaLocation(rid); if (isCorrectUrl(url)) { return createLSInput(url, id, namespaceURI); URL url = h.getSchemaLocation(namespaceURI); if (url == null) { url = h.getSchemaLocation(rid);
URL url = h.getSchemaLocation(rid); if (isCorrectUrl(url)) { return createLSInput(url, id, namespaceURI); URL url = hd.getSchemaLocation(rid); if (isCorrectUrl(url)) { return createLSInput(url, id, namespaceURI); URL url = h.getSchemaLocation(namespaceURI); if (url == null) { url = h.getSchemaLocation(rid);