Class TranslatorConfiguration
java.lang.Object
de.hybris.platform.commons.translator.TranslatorConfiguration
TranslatorConfiguration is a class that is responsible for keeping the configuration for the
Translator. This class is required in the Translator constructor.-
Constructor Summary
ConstructorsConstructorDescriptionTranslatorConfiguration(InputStream parsersConfiguration, RenderersFactory renderersFactory) This constructor should be used when parsers configuration is defined in xml fileTranslatorConfiguration(Map<String, AbstractParser> parsersConfiguration, RenderersFactory renderersFactory) This constructor should be used when parsers configuration is defined in database. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPrerenderer(Prerenderer prerenderer) addPrerendererto list of prerenderersget default rendererget parser from the configuration by the nameget all parsers namesgetlist of all availablesPrerenderergetRenderer(String name) get renderer by name (fromRenderersFactory)sget all renderers namevoidsetPrerendersList(List<Prerenderer> prerendersList) setlist ofs that would be usedin this configurationPrerenderer
-
Constructor Details
-
TranslatorConfiguration
This constructor should be used when parsers configuration is defined in xml file- Parameters:
parsersConfiguration-InputStreamwith parsers configuration (special xml)renderersFactory-that contains map of renderersRenderersFactory
-
TranslatorConfiguration
public TranslatorConfiguration(Map<String, AbstractParser> parsersConfiguration, RenderersFactory renderersFactory) This constructor should be used when parsers configuration is defined in database. Then from these configuration map has to be created and passed to this constructor.- Parameters:
parsersConfiguration- AMapthat contains configurations for parsers (Start tag of the parser <=> AbstractParser)renderersFactory-that contains map of renderersRenderersFactory
-
-
Method Details
-
getParser
get parser from the configuration by the name- Parameters:
name- name of the parser that should be returned- Returns:
- parser that was found for a given name (or null if none was found)
-
getRenderer
get renderer by name (fromRenderersFactory)s- Parameters:
name-- Returns:
- renderer that was found for a given name (or null if none was found)
-
getParsers
get all parsers names- Returns:
- set of all names of parsers from this configuration
-
getRenderers
get all renderers name- Returns:
- set of all names of renderers from this configuration
-
getDefaultRenderer
get default renderer- Returns:
- default renderer for this configuration
-
addPrerenderer
addPrerendererto list of prerenderers- Parameters:
prerenderer-
-
getPrerendersList
getlist of all availablesPrerenderer- Returns:
- list of all
Prerenderers available for this configuration
-
setPrerendersList
setlist ofs that would be usedin this configurationPrerenderer
-