Class ConstantPool

  • All Implemented Interfaces:
    Serializable

    public class ConstantPool
    extends Object
    implements Serializable
    Keeps track of ConstantPoolKey values that have already been sent to the client.

    For internal use only. May be renamed or removed in a future release.

    Since:
    1.0
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Constructor Detail

      • ConstantPool

        public ConstantPool()
    • Method Detail

      • getConstantId

        public String getConstantId​(ConstantPoolKey constant)
        Gets the id of a given constant, registering the constant with this constant pool if it hasn't already been encountered.
        Parameters:
        constant - the constant reference to get an id for, not null
        Returns:
        the constant id of the given constant, not null
        See Also:
        dumpConstants()
      • hasNewConstants

        public boolean hasNewConstants()
        Checks if any new constants have been added to this constant pool since the last time dumpConstants() was called.
        Returns:
        true if there are new constants, false otherwise
      • dumpConstants

        public elemental.json.JsonObject dumpConstants()
        Encodes all new constants to a JSON object and marks those constants as non-new.
        Returns:
        a JSON object describing all new constants