Class UniqueUIKeyGeneratorImpl

  • All Implemented Interfaces:
    UniqueUIKeyGenerator

    public class UniqueUIKeyGeneratorImpl
    extends java.lang.Object
    implements UniqueUIKeyGenerator
    Default implementation of the UniqueUIKeyGenerator.
    Re-Uses a single StringBuilder instance per thread to save heap memory. This class gets called quite often within a single requests, up to a few million times for large models.
    • Field Detail

      • KEY_SEPARATOR

        public static final java.lang.String KEY_SEPARATOR
        Separator for UIKey componets, such as Instance, group and cstic key.
        See Also:
        Constant Field Values
      • INSTANCE_SEPERATOR

        public static final java.lang.String INSTANCE_SEPERATOR
        Instance key consists of name and id, which are separated by this sepperator.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UniqueUIKeyGeneratorImpl

        public UniqueUIKeyGeneratorImpl()
    • Method Detail

      • initialValue

        protected static java.lang.StringBuilder initialValue()
      • generateGroupIdForGroup

        public java.lang.String generateGroupIdForGroup​(InstanceModel instance,
                                                        CsticGroup csticModelGroup)
        Specified by:
        generateGroupIdForGroup in interface UniqueUIKeyGenerator
        Parameters:
        instance - instance the group belongs to
        csticModelGroup - group data
        Returns:
        unique key for a UIGroup representing an Group
      • retrieveInstanceId

        public java.lang.String retrieveInstanceId​(java.lang.String uiGroupId)
        Specified by:
        retrieveInstanceId in interface UniqueUIKeyGenerator
        Parameters:
        uiGroupId - UIGroup id
        Returns:
        extract instance id from the UIGroup Id
      • generateCsticId

        public java.lang.String generateCsticId​(CsticModel model,
                                                CsticValueModel value,
                                                java.lang.String prefix)
        Description copied from interface: UniqueUIKeyGenerator
        Generates a Unique Key for a cstic, o a cstic value, if provided.
        Specified by:
        generateCsticId in interface UniqueUIKeyGenerator
        Parameters:
        model - cstic model
        value - cstic value model. If null the key is only specific for the cstic
        prefix - key prefix containing group and/or instance components
        Returns:
        unique key
      • getStrBuilder

        protected java.lang.StringBuilder getStrBuilder()