Class DescriptionsLists


  • public class DescriptionsLists
    extends java.lang.Object
    Created on 21/08/2009
    Author:
    Ana Andres
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String COMPOSITE_KEY_SUFFIX  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void fillReferenceValues​(java.util.Map<java.lang.String,​java.lang.Object> values, MetaModel metaModel, java.lang.String value)
      Overload to fill a provided map with parsed key values using only MetaModel.
      static void fillReferenceValues​(java.util.Map referenceValues, MetaReference ref, java.lang.String value, java.lang.String qualifier, java.lang.String propertyPrefix, javax.servlet.http.HttpServletRequest request, Messages errors, java.lang.String viewName)
      Fills a map with reference values from a composite key string.
      static void fillReferenceValues​(java.util.Map referenceValues, MetaReference ref, java.lang.String value, java.lang.String qualifier, java.lang.String propertyPrefix, javax.servlet.http.HttpServletRequest request, Messages errors, java.lang.String viewName, boolean emptyIfNotBracketed)
      Fills a map with reference values from a composite key string.
      static java.util.Map<java.lang.String,​java.lang.Object> parseKeyValues​(MetaModel metaModel, java.lang.String value)
      Convenience overload to parse composite key values without providing request/view.
      static java.util.Map<java.lang.String,​java.lang.Object> parseKeyValues​(MetaModel metaModel, java.lang.String value, javax.servlet.http.HttpServletRequest request, Messages errors, java.lang.String viewName, boolean emptyIfNotBracketed)
      Parses a key string using MetaModel key properties.
      static java.util.Map<java.lang.String,​java.lang.Object> parseKeyValues​(MetaModel metaModel, java.util.Collection<java.lang.String> keyPropertiesNames, java.lang.String value)
      Convenience overload to parse using provided key property names without request/view.
      static java.util.Map<java.lang.String,​java.lang.Object> parseKeyValues​(MetaModel metaModel, java.util.Collection<java.lang.String> keyPropertiesNames, java.lang.String value, javax.servlet.http.HttpServletRequest request, Messages errors, java.lang.String viewName, boolean emptyIfNotBracketed)
      Parses a key string using the given key property names instead of the MetaModel primary key.
      static void resetDescriptionsCache​(javax.servlet.http.HttpSession session)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COMPOSITE_KEY_SUFFIX

        public static final java.lang.String COMPOSITE_KEY_SUFFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • DescriptionsLists

        public DescriptionsLists()
    • Method Detail

      • resetDescriptionsCache

        public static void resetDescriptionsCache​(javax.servlet.http.HttpSession session)
      • fillReferenceValues

        public static void fillReferenceValues​(java.util.Map referenceValues,
                                               MetaReference ref,
                                               java.lang.String value,
                                               java.lang.String qualifier,
                                               java.lang.String propertyPrefix,
                                               javax.servlet.http.HttpServletRequest request,
                                               Messages errors,
                                               java.lang.String viewName,
                                               boolean emptyIfNotBracketed)
        Fills a map with reference values from a composite key string.
        Parameters:
        referenceValues - Map to be filled with reference values
        ref - MetaReference containing the reference definition
        value - String value containing the composite key
        qualifier - Qualifier for request attributes, can be null
        propertyPrefix - Prefix for property names in the map, can be null
        request - HttpServletRequest for setting attributes and parsing values
        errors - Messages object for error handling during parsing
        viewName - View name for editor formatting
        emptyIfNotBracketed - If true and value doesn't start with '[', value is set to empty string. If false and value doesn't start with '[', value is wrapped with "[." and ".]".
        Since:
        7.6
      • fillReferenceValues

        public static void fillReferenceValues​(java.util.Map referenceValues,
                                               MetaReference ref,
                                               java.lang.String value,
                                               java.lang.String qualifier,
                                               java.lang.String propertyPrefix,
                                               javax.servlet.http.HttpServletRequest request,
                                               Messages errors,
                                               java.lang.String viewName)
        Fills a map with reference values from a composite key string. This is a convenience method that uses the default behavior for Tab.
        Parameters:
        referenceValues - Map to be filled with reference values
        ref - MetaReference containing the reference definition
        value - String value containing the composite key
        qualifier - Qualifier for request attributes, can be null
        propertyPrefix - Prefix for property names in the map, can be null
        request - HttpServletRequest for setting attributes and parsing values
        errors - Messages object for error handling during parsing
        viewName - View name for editor formatting
      • parseKeyValues

        public static java.util.Map<java.lang.String,​java.lang.Object> parseKeyValues​(MetaModel metaModel,
                                                                                            java.lang.String value,
                                                                                            javax.servlet.http.HttpServletRequest request,
                                                                                            Messages errors,
                                                                                            java.lang.String viewName,
                                                                                            boolean emptyIfNotBracketed)
        Parses a key string using MetaModel key properties.

        It can be a composite key like "[.1.4.]" or a simple key like "1". Values are parsed via WebEditors.parse() to ensure consistency with editors.

        Since:
        7.6
      • parseKeyValues

        public static java.util.Map<java.lang.String,​java.lang.Object> parseKeyValues​(MetaModel metaModel,
                                                                                            java.lang.String value)
        Convenience overload to parse composite key values without providing request/view.

        It can be a composite key like "[.1.4.]" or a simple key like "1". Uses default behavior for Tab (wrap with brackets if needed).

        Since:
        7.6
      • parseKeyValues

        public static java.util.Map<java.lang.String,​java.lang.Object> parseKeyValues​(MetaModel metaModel,
                                                                                            java.util.Collection<java.lang.String> keyPropertiesNames,
                                                                                            java.lang.String value,
                                                                                            javax.servlet.http.HttpServletRequest request,
                                                                                            Messages errors,
                                                                                            java.lang.String viewName,
                                                                                            boolean emptyIfNotBracketed)
        Parses a key string using the given key property names instead of the MetaModel primary key. Reuses the same parsing logic to keep behavior consistent.
        Since:
        7.6
      • parseKeyValues

        public static java.util.Map<java.lang.String,​java.lang.Object> parseKeyValues​(MetaModel metaModel,
                                                                                            java.util.Collection<java.lang.String> keyPropertiesNames,
                                                                                            java.lang.String value)
        Convenience overload to parse using provided key property names without request/view.
        Since:
        7.6
      • fillReferenceValues

        public static void fillReferenceValues​(java.util.Map<java.lang.String,​java.lang.Object> values,
                                               MetaModel metaModel,
                                               java.lang.String value)
        Overload to fill a provided map with parsed key values using only MetaModel. Delegates to parseCompositeKeyValues to avoid duplicating parsing logic.
        Since:
        7.6