Package com.hybris.cockpitng.editors
Class EditorUtils
- java.lang.Object
-
- com.hybris.cockpitng.editors.EditorUtils
-
public final class EditorUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddReferenceSinglingMapping(java.util.Map<java.util.regex.Pattern,java.lang.String> mappings)Adds a type mapping that would change each multi reference into single referencestatic java.lang.StringgetCollectionEditorType(DataType valueType, DataType.Type collectionType)static java.lang.StringgetEditorType(DataAttribute attribute)static java.lang.StringgetEditorType(DataAttribute attribute, boolean simplifiedLocalized)static java.lang.StringgetEditorType(DataAttribute attribute, boolean simplifiedLocalized, java.util.Map<java.util.regex.Pattern,java.lang.String> customMappings)static java.lang.StringgetEditorType(DataType type)static java.lang.StringgetEditorType(DataType type, java.lang.Boolean simplifiedLocalized)static java.lang.StringgetEditorType(DataType type, java.lang.Boolean simplifiedLocalized, java.util.Map<java.util.regex.Pattern,java.lang.String> customMappings)static java.lang.StringgetEnumEditorType(java.lang.String enumCode)static java.lang.StringgetFeatureEditorType()static java.lang.StringgetFeatureValueEditorType(java.lang.String valueType)static java.util.regex.PatterngetListEditorPattern()Returns precompiled regular expression pattern identifying List Editor with capture group containing nested typestatic java.util.regex.PatterngetLocalizedEditorPattern()Returns precompiled regular expression pattern identifying localized Editor with capture group containing nested typestatic java.lang.StringgetLocalizedEditorType(java.lang.String valueType)static java.util.regex.PatterngetMapEditorPattern()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 typestatic java.lang.StringgetMapEditorType(java.lang.String keyType, java.lang.String valueType)static java.util.regex.PatterngetMultiReferenceEditorPattern()Returns precompiled regular expression pattern identifying MultiReference Editor with capture group containing nested typestatic java.lang.StringgetRangeEditorType(java.lang.String valueType)static java.util.regex.PatterngetReferenceEditorPattern()Returns precompiled regular expression pattern identifying Reference Editor with capture group containing nested typestatic java.lang.StringgetReferenceEditorType(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
-
-
-
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
-
getReferenceSinglingMapping
public 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- Returns:
- mapping to make all references single
- See Also:
getEditorType(DataAttribute, boolean, Map),getEditorType(DataType, Boolean, Map)
-
addReferenceSinglingMapping
public 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- Parameters:
mappings- current types mapping- See Also:
getEditorType(DataAttribute, boolean, Map),getEditorType(DataType, Boolean, Map)
-
getEditorType
public static java.lang.String getEditorType(DataAttribute attribute)
- Parameters:
attribute- an attribute for which the editor type should be determined- Returns:
- the type of editor
- See Also:
getEditorType(com.hybris.cockpitng.dataaccess.facades.type.DataAttribute, boolean)
-
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 foundsimplifiedLocalized-nullif not localized,trueif 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 foundsimplifiedLocalized-nullif not localized,trueif editor should be simplified (allows to choose only one localizationcustomMappings- 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)
-
-