Examples of IClassResolver


Examples of org.apache.wicket.application.IClassResolver

      try
      {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        if (Application.exists())
        {
          IClassResolver classResolver = Application.get()
              .getApplicationSettings()
              .getClassResolver();

          if (classResolver != null)
          {
            classLoader = classResolver.getClassLoader();
          }
        }

        return Proxy.newProxyInstance(classLoader,
          new Class[] { type, Serializable.class, ILazyInitProxy.class,
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver

            }


            Application application = Application.get();
            IApplicationSettings applicationSettings = application.getApplicationSettings();
            IClassResolver classResolver = applicationSettings.getClassResolver();

            Class<?> candidate = null;
            try
            {
              candidate = classResolver.resolveClass(className);
              if (candidate == null)
              {
                candidate = super.resolveClass(desc);
              }
            }
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver

        log.debug("Class not found by using objects own classloader, trying the IClassResolver");
      }

      Application application = Application.get();
      IApplicationSettings applicationSettings = application.getApplicationSettings();
      IClassResolver classResolver = applicationSettings.getClassResolver();

      Class<?> candidate = null;
      try
      {
        candidate = classResolver.resolveClass(className);
        if (candidate == null)
        {
          candidate = super.resolveClass(desc);
        }
      }
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver

    {
      int ix = resourceKey.indexOf('/');
      if (ix != -1)
      {
        String className = resourceKey.substring(0, ix);
        IClassResolver resolver = application.getApplicationSettings().getClassResolver();
        Class<?> scope = null;
        try
        {
          // First try to match mounted resources.
          scope = Application.get().getSharedResources().getAliasClass(className);

          // If that fails, resolve it as a fully qualified class
          // name.
          if (scope == null)
          {
            scope = resolver.resolveClass(className);
          }

          // get path component of resource key, replace '..' with
          // escape sequence to
          // prevent crippled urls in browser
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver

        // Obviously a href like href="myPkg.MyLabel.html" will do as
        // well. Wicket will not throw an exception. It accepts it.


        Page page = container.getPage();
        final IClassResolver defaultClassResolver = page.getApplication()
          .getApplicationSettings()
          .getClassResolver();
        String className = Packages.absolutePath(page.getClass(), pathInfo.path);
        className = Strings.replaceAll(className, "/", ".").toString();
        if (className.startsWith("."))
        {
          className = className.substring(1);
        }

        try
        {
          final Class<? extends Page> clazz = (Class<? extends Page>)defaultClassResolver.resolveClass(className);
          return new AutolinkBookmarkablePageLink<Void>(autoId, clazz,
            pathInfo.pageParameters, pathInfo.anchor);
        }
        catch (ClassNotFoundException ex)
        {
          log.warn("Did not find corresponding java class: " + className);
          // fall through
        }

        // Make sure base markup pages (inheritance) are handled correct
        MarkupContainer parentWithContainer = container;
        if (container.getParent() != null)
        {
          parentWithContainer = container.findParentWithAssociatedMarkup();
        }
        if ((parentWithContainer instanceof Page) && !pathInfo.path.startsWith("/") &&
          page.getMarkupStream().isMergedMarkup())
        {
          Class<? extends Page> clazz = (Class<? extends Page>)container.getMarkupStream()
            .getTag()
            .getMarkupClass();
          if (clazz != null)
          {
            // Href is relative. Resolve the url given relative to
            // the current page
            className = Packages.absolutePath(clazz, pathInfo.path);
            className = Strings.replaceAll(className, "/", ".").toString();
            if (className.startsWith("."))
            {
              className = className.substring(1);
            }

            try
            {
              clazz = (Class<? extends Page>)defaultClassResolver.resolveClass(className);
              return new AutolinkBookmarkablePageLink<Void>(autoId, clazz,
                pathInfo.getPageParameters(), pathInfo.anchor);
            }
            catch (ClassNotFoundException ex)
            {
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver

        // Obviously a href like href="myPkg.MyLabel.html" will do as
        // well. Wicket will not throw an exception. It accepts it.


        Page page = container.getPage();
        final IClassResolver defaultClassResolver = page.getApplication()
          .getApplicationSettings()
          .getClassResolver();
        String className = Packages.absolutePath(page.getClass(), pathInfo.path);
        className = Strings.replaceAll(className, "/", ".").toString();
        if (className.startsWith("."))
        {
          className = className.substring(1);
        }

        try
        {
          final Class clazz = defaultClassResolver.resolveClass(className);
          return new AutolinkBookmarkablePageLink(autoId, clazz, pathInfo.pageParameters,
            pathInfo.anchor);
        }
        catch (ClassNotFoundException ex)
        {
          log.warn("Did not find corresponding java class: " + className);
          // fall through
        }

        // Make sure base markup pages (inheritance) are handled correct
        MarkupContainer parentWithContainer = container;
        if (container.getParent() != null)
        {
          parentWithContainer = container.findParentWithAssociatedMarkup();
        }
        if ((parentWithContainer instanceof Page) && !pathInfo.path.startsWith("/") &&
          page.getMarkupStream().isMergedMarkup())
        {
          Class clazz = container.getMarkupStream().getTag().getMarkupClass();
          if (clazz != null)
          {
            // Href is relative. Resolve the url given relative to
            // the current page
            className = Packages.absolutePath(clazz, pathInfo.path);
            className = Strings.replaceAll(className, "/", ".").toString();
            if (className.startsWith("."))
            {
              className = className.substring(1);
            }

            try
            {
              clazz = defaultClassResolver.resolveClass(className);
              return new AutolinkBookmarkablePageLink(autoId, clazz,
                pathInfo.getPageParameters(), pathInfo.anchor);
            }
            catch (ClassNotFoundException ex)
            {
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver

        // Can the application always be taken??
        // Should be if serialization happened in thread with application set
        // (WICKET-2195)
        Application application = Application.get();
        IApplicationSettings applicationSettings = application.getApplicationSettings();
        IClassResolver classResolver = applicationSettings.getClassResolver();

        candidate = classResolver.resolveClass(className);
        if (candidate == null)
        {
          candidate = super.resolveClass(desc);
        }
      }
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver

        // Obviously a href like href="myPkg.MyLabel.html" will do as
        // well. Wicket will not throw an exception. It accepts it.
        String infoPath = Strings.replaceAll(pathInfo.path, "/", ".").toString();

        Page page = container.getPage();
        final IClassResolver defaultClassResolver = page.getApplication()
            .getApplicationSettings().getClassResolver();

        String className;
        if (!infoPath.startsWith("."))
        {
          // Href is relative. Resolve the url given relative to the
          // current page
          className = Packages.extractPackageName(page.getClass()) + "." + infoPath;
        }
        else
        {
          // Href is absolute. If class with the same absolute path
          // exists, use it. Else don't change the href.
          className = infoPath.substring(1);
        }

        try
        {
          final Class clazz = defaultClassResolver.resolveClass(className);
          return new AutolinkBookmarkablePageLink(autoId, clazz, pathInfo.pageParameters,
              pathInfo.anchor);
        }
        catch (ClassNotFoundException ex)
        {
          log.warn("Did not find corresponding java class: " + className);
          // fall through
        }

        // Make sure base markup pages (inheritance) are handled correct
        MarkupContainer parentWithContainer = container;
        if (container.getParent() != null)
        {
          parentWithContainer = container.findParentWithAssociatedMarkup();
        }
        if ((parentWithContainer instanceof Page) && !infoPath.startsWith(".") &&
            page.getMarkupStream().isMergedMarkup())
        {
          Class clazz = container.getMarkupStream().getTag().getMarkupClass();
          if (clazz != null)
          {
            // Href is relative. Resolve the url given relative to
            // the current page
            className = Packages.extractPackageName(clazz) + "." + infoPath;

            try
            {
              clazz = defaultClassResolver.resolveClass(className);
              return new AutolinkBookmarkablePageLink(autoId, clazz, pathInfo
                  .getPageParameters(), pathInfo.anchor);
            }
            catch (ClassNotFoundException ex)
            {
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver

    {
      int ix = resourceKey.indexOf('/');
      if (ix != -1)
      {
        String className = resourceKey.substring(0, ix);
        IClassResolver resolver = application.getApplicationSettings().getClassResolver();
        Class scope = null;
        try
        {
          // First try to match mounted resources.
          scope = Application.get().getSharedResources().getAliasClass(className);

          // If that fails, resolve it as a fully qualified class
          // name.
          if (scope == null)
          {
            scope = resolver.resolveClass(className);
          }
          String path = resourceKey.substring(ix + 1);

          PackageResource packageResource = PackageResource.get(scope, path);
          if (sharedResources.get(resourceKey) == null)
View Full Code Here

Examples of org.apache.wicket.application.IClassResolver


            Application application = Application.get();
            IApplicationSettings applicationSettings = application
                .getApplicationSettings();
            IClassResolver classResolver = applicationSettings.getClassResolver();

            Class candidate = null;
            try
            {
              candidate = classResolver.resolveClass(className);
              if (candidate == null)
              {
                candidate = super.resolveClass(desc);
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.