Package org.springframework.beans.factory.xml

Examples of org.springframework.beans.factory.xml.NamespaceHandlerResolver


        ConfigurationPointsImpl cps = new ConfigurationPointsImpl(classLoader);
        SpringPluggableSchemas sps = new SpringPluggableSchemas(resourceLoader);

        // default resolvers
        EntityResolver defaultEntityResolver = new ResourceEntityResolver(resourceLoader);
        NamespaceHandlerResolver defaultNamespaceHanderResolver = new DefaultNamespaceHandlerResolver(classLoader);

        // new resolvers
        EntityResolver entityResolver = new SchemaEntityResolver(defaultEntityResolver, cps, sps);
        NamespaceHandlerResolver namespaceHandlerResolver = new ConfigurationPointNamespaceHandlerResolver(cps,
                defaultNamespaceHanderResolver);

        reader.setEntityResolver(entityResolver);
        reader.setNamespaceHandlerResolver(namespaceHandlerResolver);
    }
View Full Code Here


        // schema providers
        SpringExtSchemaSet schemas = new SpringExtSchemaSet(classLoader);

        // default resolvers
        EntityResolver defaultEntityResolver = new ResourceEntityResolver(resourceLoader);
        NamespaceHandlerResolver defaultNamespaceHandlerResolver = new DefaultNamespaceHandlerResolver(classLoader);

        // new resolvers
        EntityResolver entityResolver = new SchemaEntityResolver(defaultEntityResolver, schemas);
        NamespaceHandlerResolver namespaceHandlerResolver = new ConfigurationPointNamespaceHandlerResolver(schemas.getConfigurationPoints(), defaultNamespaceHandlerResolver);

        reader.setEntityResolver(entityResolver);
        reader.setNamespaceHandlerResolver(namespaceHandlerResolver);
    }
View Full Code Here

  public NamespaceHandler resolve(String namespaceUri) {
    boolean trace = log.isTraceEnabled();

    for (Iterator iterator = resolvers.entrySet().iterator(); iterator.hasNext();) {
      Map.Entry entry = (Map.Entry) iterator.next();
      NamespaceHandlerResolver handlerResolver = (NamespaceHandlerResolver) entry.getKey();
      if (trace)
        log.trace("Trying to resolve namespace [" + namespaceUri + "] through resolver " + entry.getValue());
      NamespaceHandler handler = handlerResolver.resolve(namespaceUri);

      String resolvedMsg = (handler != null ? "" : "not ");
      if (trace)
        log.trace("Namespace [" + namespaceUri + "] was " + resolvedMsg + "resolved through handler resolver "
            + entry.getValue());
View Full Code Here

  private NamespaceHandlerResolver createNamespaceHandlerResolver(BundleContext bundleContext, String filter,
      ClassLoader bundleClassLoader) {
    Assert.notNull(bundleContext, "bundleContext is required");
    // create local namespace resolver
    // we'll use the default resolver which uses the bundle local class-loader
    NamespaceHandlerResolver localNamespaceResolver = new DefaultNamespaceHandlerResolver(bundleClassLoader);

    // hook in OSGi namespace resolver
    NamespaceHandlerResolver osgiServiceNamespaceResolver = lookupNamespaceHandlerResolver(bundleContext, filter,
        localNamespaceResolver);

    DelegatedNamespaceHandlerResolver delegate = new DelegatedNamespaceHandlerResolver();
    delegate.addNamespaceHandler(localNamespaceResolver, "LocalNamespaceResolver for bundle "
        + OsgiStringUtils.nullSafeNameAndSymName(bundleContext.getBundle()));
View Full Code Here

          registry = new ScannedGenericBeanDefinitionSuppressingBeanDefinitionRegistry();
          EntityResolver resolver = new XmlCatalogDelegatingEntityResolver(new BeansDtdResolver(), new PluggableSchemaResolver(namespaceResolvingClassloader));
          final DocumentAccessor documentAccessor = new DocumentAccessor();
          final SourceExtractor sourceExtractor = new DelegatingSourceExtractor(file.getProject());
          final BeansConfigReaderEventListener eventListener = new BeansConfigReaderEventListener(this, resource, sourceExtractor, documentAccessor);
          final NamespaceHandlerResolver namespaceHandlerResolver = new DelegatingNamespaceHandlerResolver(namespaceResolvingClassloader, this,  documentAccessor);
         
          problemReporter = new BeansConfigProblemReporter();
          beanNameGenerator = new UniqueBeanNameGenerator(this);

          final XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(registry) {
View Full Code Here

            if ("namespaceHandlerResolver".equals(config.getName()) && config.getAttribute("class") != null) {
              try {
                String handlerClassName = config.getAttribute("class");
                Object handler = loadHandler(extension.getContributor().getName(), handlerClassName);
                if (handler instanceof NamespaceHandlerResolver) {
                  NamespaceHandlerResolver namespaceHandlerResolver = (NamespaceHandlerResolver) handler;
                  handlers.add(namespaceHandlerResolver);
                }
              }
              catch (InvalidRegistryObjectException e) {
                BeansCorePlugin.log(e);
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.xml.NamespaceHandlerResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.