Class EditorUtils


  • public final class EditorUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addReferenceSinglingMapping​(java.util.Map<java.util.regex.Pattern,​java.lang.String> mappings)
      Adds a type mapping that would change each multi reference into single reference
      static java.lang.String getCollectionEditorType​(DataType valueType, DataType.Type collectionType)  
      static java.lang.String getEditorType​(DataAttribute attribute)  
      static java.lang.String getEditorType​(DataAttribute attribute, boolean simplifiedLocalized)  
      static java.lang.String getEditorType​(DataAttribute attribute, boolean simplifiedLocalized, java.util.Map<java.util.regex.Pattern,​java.lang.String> customMappings)  
      static java.lang.String getEditorType​(DataType type)  
      static java.lang.String getEditorType​(DataType type, java.lang.Boolean simplifiedLocalized)  
      static java.lang.String getEditorType​(DataType type, java.lang.Boolean simplifiedLocalized, java.util.Map<java.util.regex.Pattern,​java.lang.String> customMappings)  
      static java.lang.String getEnumEditorType​(java.lang.String enumCode)  
      static java.lang.String getFeatureEditorType()  
      static java.lang.String getFeatureValueEditorType​(java.lang.String valueType)  
      static java.util.regex.Pattern getListEditorPattern()
      Returns precompiled regular expression pattern identifying List Editor with capture group containing nested type
      static java.util.regex.Pattern getLocalizedEditorPattern()
      Returns precompiled regular expression pattern identifying localized Editor with capture group containing nested type
      static java.lang.String getLocalizedEditorType​(java.lang.String valueType)  
      static java.util.regex.Pattern getMapEditorPattern()
      Returns precompiled regular expression pattern identifying Map Editor with capture group 1 containing map's key type and capture group 2 containing map's value type
      static java.lang.String getMapEditorType​(java.lang.String keyType, java.lang.String valueType)  
      static java.util.regex.Pattern getMultiReferenceEditorPattern()
      Returns precompiled regular expression pattern identifying MultiReference Editor with capture group containing nested type
      static java.lang.String getRangeEditorType​(java.lang.String valueType)  
      static java.util.regex.Pattern getReferenceEditorPattern()
      Returns precompiled regular expression pattern identifying Reference Editor with capture group containing nested type
      static java.lang.String getReferenceEditorType​(java.lang.String typeCode)  
      static java.util.Map.Entry<java.util.regex.Pattern,​java.lang.String> getReferenceSinglingMapping()
      Gets a type mapping that would change each multi reference into single reference
      • Methods inherited from class java.lang.Object

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

      • getLocalizedEditorPattern

        public static java.util.regex.Pattern getLocalizedEditorPattern()
        Returns precompiled regular expression pattern identifying localized Editor with capture group containing nested type
      • getReferenceEditorPattern

        public static java.util.regex.Pattern getReferenceEditorPattern()
        Returns precompiled regular expression pattern identifying Reference Editor with capture group containing nested type
      • getMultiReferenceEditorPattern

        public static java.util.regex.Pattern getMultiReferenceEditorPattern()
        Returns precompiled regular expression pattern identifying MultiReference Editor with capture group containing nested type
      • getListEditorPattern

        public static java.util.regex.Pattern getListEditorPattern()
        Returns precompiled regular expression pattern identifying List Editor with capture group containing nested type
      • getMapEditorPattern

        public static java.util.regex.Pattern getMapEditorPattern()
        Returns precompiled regular expression pattern identifying Map Editor with capture group 1 containing map's key type and capture group 2 containing map's value type
      • getEditorType

        public static java.lang.String getEditorType​(DataAttribute attribute,
                                                     boolean simplifiedLocalized,
                                                     java.util.Map<java.util.regex.Pattern,​java.lang.String> customMappings)
      • getEditorType

        public static java.lang.String getEditorType​(DataAttribute attribute,
                                                     boolean simplifiedLocalized)
      • getEditorType

        public static java.lang.String getEditorType​(DataType type)
      • getEditorType

        public static java.lang.String getEditorType​(DataType type,
                                                     java.lang.Boolean simplifiedLocalized)
        Parameters:
        type - type of data for which editor is to be found
        simplifiedLocalized - null if not localized, true if editor should be simplified (allows to choose only one localization
        Returns:
        identity of editor to be used
      • getEditorType

        public static java.lang.String getEditorType​(DataType type,
                                                     java.lang.Boolean simplifiedLocalized,
                                                     java.util.Map<java.util.regex.Pattern,​java.lang.String> customMappings)
        Parameters:
        type - type of data for which editor is to be found
        simplifiedLocalized - null if not localized, true if editor should be simplified (allows to choose only one localization
        customMappings - maps data type patterns to editor types (i.e. multiple references into single reference)
        Returns:
        identity of editor to be used
      • getMapEditorType

        public static java.lang.String getMapEditorType​(java.lang.String keyType,
                                                        java.lang.String valueType)
      • getEnumEditorType

        public static java.lang.String getEnumEditorType​(java.lang.String enumCode)
      • getReferenceEditorType

        public static java.lang.String getReferenceEditorType​(java.lang.String typeCode)
      • getCollectionEditorType

        public static java.lang.String getCollectionEditorType​(DataType valueType,
                                                               DataType.Type collectionType)
      • getRangeEditorType

        public static java.lang.String getRangeEditorType​(java.lang.String valueType)
      • getLocalizedEditorType

        public static java.lang.String getLocalizedEditorType​(java.lang.String valueType)
      • getFeatureEditorType

        public static java.lang.String getFeatureEditorType()
      • getFeatureValueEditorType

        public static java.lang.String getFeatureValueEditorType​(java.lang.String valueType)