Class ArrayTypeExtender

java.lang.Object
manifold.internal.javac.ArrayTypeExtender

public class ArrayTypeExtender extends Object
  • Constructor Details

    • ArrayTypeExtender

      public ArrayTypeExtender()
  • Method Details

    • extend

      public static void extend(com.sun.tools.javac.util.Context context, com.sun.source.tree.CompilationUnitTree compilingClass)
      Array types in Java all share the same symbol, Symtab.arrayClass. For example, int[], String[], Foo[], and long[][] all share the same symbol instance. Also, Java has no base type for the array class; there's no "java.lang.Array" to add extension methods to. Therefore, Manifold provides a substitute type for the sole purpose of adding extension methods, namely manifold.rt.api.Array. Extension classes extending this class effectively extend Java's array class.