Class ClassCache

java.lang.Object
gw.internal.gosu.parser.ClassCache

public class ClassCache extends Object
  • Field Details

  • Constructor Details

    • ClassCache

      public ClassCache(IModule module)
  • Method Details

    • tryToLoadClass

      private Class tryToLoadClass(CharSequence name)
    • addFoundPackages

      private void addFoundPackages(Class<?> aClass)
    • classFileExists

      public boolean classFileExists(String className)
    • loadAsmClass

      public AsmClass loadAsmClass(String className)
    • loadClass

      public Class loadClass(String className)
    • isPackage

      private boolean isPackage(StringBuilder s, int i)
      Short-circuit the case where com.foo.Fred is not a class name, but com.foo is a package. Avoid the expensive test for com.foo$Fred as an inner class (and then com$foo$Fred).

      Yes, java supports a package and a class having the same name, but in this case we are checking for an inner class of a class having the same name as a package... Let's just not support references to those in Gosu in the name of both sanity and performance.

      Warning this design decision was not vetted through various committees, architect round tables, community processes, or guys with beards.

    • loadClassImplImpl

      private Class loadClassImplImpl(String type)
    • normalizeArrayNotation

      private static String normalizeArrayNotation(String type)
      Normalizes a class name string to the appropriate java class name. For example:

      java.lang.String -> java.lang.String java.lang.String[] -> [Ljava.lang.String; java.lang.String[][] -> [[Ljava.lang.String;

      Parameters:
      type - Name of type
      Returns:
      ormalizes a class name string to the appropriate java class name
    • getAllTypeNames

      public Set<String> getAllTypeNames()
    • clearClasspathInfo

      public void clearClasspathInfo()
    • remove

      public void remove(String fullyQualifiedName)
    • dispose

      public void dispose()
    • reassignClassLoader

      public void reassignClassLoader()
      Called in Single module mode. If the parent loader of the ModuleClassLoader is the GosuPluginContainer, we drop the ModuleClassLoader and its parent, the GosuPluginContainer. New ones are created and assigned here. Note, this is a giant hack among many gianter hacks that keep the old test framework floating.
    • hasNamespace

      public boolean hasNamespace(String namespace)
    • getTypeNames

      public Set<TypeName> getTypeNames(String namespace)