Class ColorDeserializer


  • public final class ColorDeserializer
    extends java.lang.Object
    Convert a TypePool (from a single compilation) into Colors.

    Future work will be necessary to let this class convert multiple type-pools coming from different libraries. For now it only handles a single type-pool.

    • Method Detail

      • buildFromTypePool

        public static ColorDeserializer buildFromTypePool​(com.google.javascript.jscomp.serialization.TypePool typePool,
                                                          com.google.javascript.jscomp.serialization.StringPool stringPool)
        Builds a pool of Colors and a ColorRegistry from the given pool of types.

        This method does all of the deserialization work in advance so that getRegistry() and pointerToColor(TypePointer) willexecute in constant time.

      • pointerToColor

        public Color pointerToColor​(com.google.javascript.jscomp.serialization.TypePointer typePointer)