Class SimpleEditorRegistry
- java.lang.Object
-
- com.hybris.cockpitng.editor.registry.impl.SimpleEditorRegistry
-
- All Implemented Interfaces:
Resettable,EditorRegistry
public class SimpleEditorRegistry extends java.lang.Object implements EditorRegistry, Resettable
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringNO_EDITOR_AVAILABLEprotected java.util.Map<java.lang.String,java.lang.String>typeToEditorCache
-
Constructor Summary
Constructors Constructor Description SimpleEditorRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ClassLoadergetClassLoader()java.lang.StringgetDefaultEditorCode()java.lang.StringgetDefaultEditorCode(java.lang.String editorType)Return the default editor code (example: 'com.hybris.cockpitng.editor.default.text') for the given editorType (example: 'TEXT')java.util.Map<java.lang.String,java.lang.String>getDefaultEditorMapping()EditorDefinitiongetEditorForCode(java.lang.String editorDefinitionCode)Returns for the given definition code.EditorDefinitiongetEditorForType(java.lang.String editorType)Returns an editor for the given value type.protected EditorDefinitiongetEditorForType(java.lang.String editorType, boolean scanSuperclasses)EditorDefinitiongetFallbackEditor()Returns an editor that should be used in case there is no dedicated editor.voidreset()Resets the something the implementation provides.voidsetComponentDefinitionService(CockpitComponentDefinitionService componentDefinitionService)voidsetDefaultEditorCode(java.lang.String defaultEditorCode)voidsetDefaultEditorMapping(java.util.Map<java.lang.String,java.lang.String> defaultEditorMapping)
-
-
-
Field Detail
-
NO_EDITOR_AVAILABLE
protected static final java.lang.String NO_EDITOR_AVAILABLE
- See Also:
- Constant Field Values
-
typeToEditorCache
protected final java.util.Map<java.lang.String,java.lang.String> typeToEditorCache
-
-
Method Detail
-
getEditorForType
public EditorDefinition getEditorForType(java.lang.String editorType)
Description copied from interface:EditorRegistryReturns an editor for the given value type.- Specified by:
getEditorForTypein interfaceEditorRegistry- Parameters:
editorType- value type (e.g. java.lang.String)- Returns:
- editor for the given value type or
nullif no suitable editor found
-
getEditorForType
protected EditorDefinition getEditorForType(java.lang.String editorType, boolean scanSuperclasses)
-
getClassLoader
protected java.lang.ClassLoader getClassLoader()
-
getEditorForCode
public EditorDefinition getEditorForCode(java.lang.String editorDefinitionCode)
Description copied from interface:EditorRegistryReturns for the given definition code.- Specified by:
getEditorForCodein interfaceEditorRegistry- Parameters:
editorDefinitionCode- The definition code (ID) of the editor to be found- Returns:
- Editor for the given definition code (ID) or
nullif editor with such definition code does not exist.
-
setComponentDefinitionService
public void setComponentDefinitionService(CockpitComponentDefinitionService componentDefinitionService)
-
getDefaultEditorCode
public java.lang.String getDefaultEditorCode(java.lang.String editorType)
Return the default editor code (example: 'com.hybris.cockpitng.editor.default.text') for the given editorType (example: 'TEXT')- Specified by:
getDefaultEditorCodein interfaceEditorRegistry- Returns:
- the default editor code for given editorType
-
getFallbackEditor
public EditorDefinition getFallbackEditor()
Description copied from interface:EditorRegistryReturns an editor that should be used in case there is no dedicated editor.- Specified by:
getFallbackEditorin interfaceEditorRegistry- Returns:
- default editor (may be null)
-
setDefaultEditorMapping
public void setDefaultEditorMapping(java.util.Map<java.lang.String,java.lang.String> defaultEditorMapping)
-
reset
public void reset()
Description copied from interface:ResettableResets the something the implementation provides.- Specified by:
resetin interfaceResettable
-
getDefaultEditorCode
public java.lang.String getDefaultEditorCode()
-
setDefaultEditorCode
public void setDefaultEditorCode(java.lang.String defaultEditorCode)
-
getDefaultEditorMapping
public java.util.Map<java.lang.String,java.lang.String> getDefaultEditorMapping()
-
-