Parses the given configuration String.<p>

@param configuration the configuration String to parse
515016
protected void parseOptions(String configuration) {

        if (CmsStringUtil.isNotEmpty(configuration)) {

            CmsPair<String, Map<String, String>> simplifiedStringAndGalleryOptions = parseEmbeddedGalleryOptions(
                configuration);
            configuration = simplifiedStringAndGalleryOptions.getFirst();
            m_embeddedConfigurations = simplifiedStringAndGalleryOptions.getSecond();

            List<String> options = CmsStringUtil.splitAsList(configuration, DELIMITER_OPTION, true);
            Iterator<String> i = options.iterator();
            while (i.hasNext()) {
                String option = i.next();
                // check which option is defined
                if (option.startsWith(OPTION_FORMATSELECT_OPTIONS)) {
                    // the format select options
                    option = option.substring(OPTION_FORMATSELECT_OPTIONS.length());
                    setFormatSelectOptions(option);
                } else if (option.startsWith(OPTION_HEIGHT)) {
                    // the editor height
                    option = option.substring(OPTION_HEIGHT.length());
                    if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(option)) {
                        setEditorHeight(option);
                    }
                } else if (option.startsWith(OPTION_HIDEBUTTONS)) {
                    // buttons to hide from the tool bar
                    option = option.substring(OPTION_HIDEBUTTONS.length());
                    setHiddenButtons(CmsStringUtil.splitAsList(option, DELIMITER_VALUE, true));
                } else if (option.startsWith(OPTION_CSS)) {
                    // the editor CSS
                    option = option.substring(OPTION_CSS.length());
                    setCssPath(option);
                } else if (option.startsWith(OPTION_STYLES)) {
                    // the editor styles XML path
                    option = option.substring(OPTION_STYLES.length());
                    setStylesXmlPath(option);
                } else if (option.startsWith(OPTION_STYLES_FORMAT)) {
                    // the editor styles format path
                    option = option.substring(OPTION_STYLES_FORMAT.length());
                    setStylesFormatPath(option);
                } else if (option.startsWith(OPTION_BUTTONBAR)) {
                    // the button bar definition string
                    option = option.substring(OPTION_BUTTONBAR.length());
                    setButtonBarOptionString(option);
                } else if (option.startsWith(OPTION_IMPORTCSS)) {
                    m_importCss = true;
                } else if (option.startsWith(OPTION_ALLOWSCRIPTS)) {
                    m_allowScripts = true;
                } else {
                    // check if option describes an additional button
                    if (OPTIONAL_BUTTONS_LIST.contains(option)) {
                        addAdditionalButton(option);
                    }
                }
            }
        }
    }
970503
protected void parseOptions(String configuration) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(configuration)) {
            return;
        }
        if (!configuration.startsWith("{")) {
            // add curly braces if not present
            configuration = "{" + configuration + "}";
        }
        try {
            JSONObject json = new JSONObject(configuration);
            if (json.has(OPTION_LAT)) {
                setLat((float)json.getDouble(OPTION_LAT));
            }
            if (json.has(OPTION_LNG)) {
                setLng((float)json.getDouble(OPTION_LNG));
            }
            if (json.has(OPTION_ZOOM)) {
                setZoom(json.getInt(OPTION_ZOOM));
            }
            if (json.has(OPTION_WIDTH)) {
                setWidth(json.getInt(OPTION_WIDTH));
            }
            if (json.has(OPTION_HEIGHT)) {
                setHeight(json.getInt(OPTION_HEIGHT));
            }
            if (json.has(OPTION_TYPE)) {
                setType(MapType.valueOf(json.getString(OPTION_TYPE)));
            }
            if (json.has(OPTION_MODE)) {
                // do not use value of, as the client side string is not equal to the enumeration mode name
                setMode(MapMode.parseMode(json.getString(OPTION_MODE)));
            }
        } catch (JSONException e) {
            // something went wrong
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            return;
        }
    }
309317
public ActionDeclaration withConfiguration(java.util.Map<String, String> configuration) {
        setConfiguration(configuration);
        return this;
    }
1290773
@Override
	public void configure(Configuration parameters) {
		super.configure(parameters);
		
		// get the charset for the decoding
		String charsetName = parameters.getString(CHARSET_NAME, DEFAULT_CHARSET_NAME);
		if (charsetName == null || !Charset.isSupported(charsetName)) {
			throw new RuntimeException("Unsupported charset: " + charsetName);
		}
		
		if (charsetName.equals("ISO-8859-1") || charsetName.equalsIgnoreCase("ASCII")) {
			this.ascii = true;
		} else {
			this.decoder = Charset.forName(charsetName).newDecoder();
			this.byteWrapper = ByteBuffer.allocate(1);
		}
		
		// get the field position to write in the record
		this.pos = parameters.getInteger(FIELD_POS, 0);
		if (this.pos < 0) {
			throw new RuntimeException("Illegal configuration value for the target position: " + this.pos);
		}
	}
169803
public Map<String, List<? extends SipApplicationRouterInfo>> parse(String configuration) throws ParseException {
        Properties tempProperties = new Properties();
        // tempProperties.load(new StringReader(configuration)); // This needs Java 1.6
        ByteArrayInputStream stringStream = new ByteArrayInputStream(configuration.getBytes());
        try {
            tempProperties.load(stringStream);
        } catch (IOException e) {
            log.warn("Failed to update AR configuration. Will use the old properties.");
            return null;
        }
        this.properties = tempProperties;
        return parse();
    }
267630
public void setConfigurations(Collection<? extends Configuration> configurations) {
		Assert.notNull(configurations, "Configurations must not be null");
		this.configurations = new ArrayList<>(configurations);
	}
1272992
private void parseLoggerConfig(final Node node,
			final ConfigSettings config, final ConfigurationKeys logPath,
			final ConfigurationKeys logLevel)
	{

		String name, value;
		Level level;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_LOG_PATH)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				value = value.substring(1, value.length() - 1);
				config.setConfigParameter(logPath, value);

			}
			else if (name.equals(KEY_LOG_LEVEL)) {

				level = Level.valueOf(nnode.getChildNodes().item(0)
						.getNodeValue());
				config.setConfigParameter(logLevel, level);
			}
		}
	}
619118
public void setConfiguration(Configuration configuration) {

        this.configuration = configuration;

        // init ParamReaders with the new <Configuration>
        ParamReaders.getInstance().setConfiguration(configuration);

        // register as listener to configuration change
        FoundationConfigurationListenerRegistry.addFoundationConfigurationListener(this);

        // verify that all configured values are correct
        verifyConfiguration();

    }
1332773
public static CmsPair<String, Map<String, String>> parseEmbeddedGalleryOptions(String configuration) {

        final Map<String, String> galleryOptions = Maps.newHashMap();
        String resultConfig = CmsStringUtil.substitute(
            PATTERN_EMBEDDED_GALLERY_CONFIG,
            configuration,
            new I_CmsRegexSubstitution() {

                public String substituteMatch(String string, Matcher matcher) {

                    String galleryName = string.substring(matcher.start(1), matcher.end(1));
                    String embeddedConfig = string.substring(matcher.start(2), matcher.end(2));
                    galleryOptions.put(galleryName, embeddedConfig);
                    return galleryName;
                }
            });
        return CmsPair.create(resultConfig, galleryOptions);
    }
1062030
public final void initConfiguration(String config) {

        m_configuration = config;
        m_configurationMap = CmsStringUtil.splitAsMap(config, "|", ":");
        m_configurationMap.put(CmsContentDefinition.PARAM_INIT_CALL, INIT_FUNCTION_PREFIX + getName());
        m_jsonConfig = new JSONObject(new HashMap<String, Object>(m_configurationMap));
    }
48384
private static List<String> toConfigurationStringList(final Configuration c) {
    final ConfigurationImpl conf = (ConfigurationImpl) c;
    final List<String> l = new ArrayList<>();
    for (final ClassNode<?> opt : conf.getBoundImplementations()) {
      l.add(opt.getFullName()
          + '='
          + escape(conf.getBoundImplementation(opt).getFullName()));
    }
    for (final ClassNode<?> opt : conf.getBoundConstructors()) {
      l.add(opt.getFullName()
          + '='
          + escape(conf.getBoundConstructor(opt).getFullName()));
    }
    for (final NamedParameterNode<?> opt : conf.getNamedParameters()) {
      l.add(opt.getFullName()
          + '='
          + escape(conf.getNamedParameter(opt)));
    }
    for (final ClassNode<?> cn : conf.getLegacyConstructors()) {
      final StringBuilder sb = new StringBuilder();
      join(sb, "-", conf.getLegacyConstructor(cn).getArgs());
      l.add(cn.getFullName()
          + escape('='
              + ConfigurationBuilderImpl.INIT
              + '('
              + sb.toString()
              + ')'
      ));
    }
    for (final NamedParameterNode<Set<?>> key : conf.getBoundSets()) {
      for (final Object value : conf.getBoundSet(key)) {
        final String val;
        if (value instanceof String) {
          val = (String) value;
        } else if (value instanceof Node) {
          val = ((Node) value).getFullName();
        } else {
          throw new IllegalStateException("The value bound to a given NamedParameterNode "
                  + key + " is neither the set of class hierarchy nodes nor strings.");
        }
        l.add(key.getFullName() + '=' + escape(val));
      }
    }
    return l;
  }
937303
private void parseDebugConfig(final Node node, final ConfigSettings config)
	{

		String name;
		Boolean value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_VERIFICATION_DIFF)) {

				value = Boolean.parseBoolean(nnode.getChildNodes().item(0)
						.getNodeValue());
				config.setConfigParameter(ConfigurationKeys.VERIFICATION_DIFF,
						value);

			}
			else if (name.equals(KEY_VERIFICATION_ENCODING)) {

				value = Boolean.parseBoolean(nnode.getChildNodes().item(0)
						.getNodeValue());

				config.setConfigParameter(
						ConfigurationKeys.VERIFICATION_ENCODING, value);

			}
			else if (name.equals(KEY_STATISTICAL_OUTPUT)) {

				value = Boolean.parseBoolean(nnode.getChildNodes().item(0)
						.getNodeValue());
				config.setConfigParameter(
						ConfigurationKeys.MODE_STATISTICAL_OUTPUT, value);

			}
			else if (name.equals(SUBSECTION_DEBUG_OUTPUT)) {

				parseDebugOutputConfig(nnode, config);
			}
		}
	}
148076
protected function loadFromString($configuration, ParserInterface $parser)
    {
        $this->data = [];

        // Try to parse string
        $this->data = array_replace_recursive($this->data, $parser->parseString($configuration));
    }
162623
private void parseExternalsConfig(final Node node,
			final ConfigSettings config)
	{

		String name, value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_SEVENZIP)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				value = value.substring(1, value.length() - 1);

				config.setConfigParameter(ConfigurationKeys.PATH_PROGRAM_7ZIP,
						value);

			}
		}
	}
626667
private void parseConfiguration(String config) {

        CmsSelectConfigurationParser parser = new CmsSelectConfigurationParser(config);
        // set the help info first!!
        for (Entry<String, String> helpEntry : parser.getHelpTexts().entrySet()) {
            m_selectBox.setTitle(helpEntry.getKey(), helpEntry.getValue());
        }
        //set value and option to the combo box.
        m_selectBox.setItems(parser.getOptions());
        //if one entrance is declared for default.
        if (parser.getDefaultValue() != null) {
            //set the declared value selected.
            m_selectBox.selectValue(parser.getDefaultValue());
            m_defaultValue = parser.getDefaultValue();
        }
        fireChangeEvent();
    }
254775
protected void registerConfiguration(@Nonnull BeanConfiguration configuration) {
        ArgumentUtils.requireNonNull("configuration", configuration);
        beanConfigurations.put(configuration.getName(), configuration);
        ClassLoadingReporter.reportPresent(configuration.getClass());
    }
802907
private void parseConfiguration(CmsObject cms, CmsMessages widgetDialog) {

        String configString = CmsMacroResolver.resolveMacros(getConfiguration(), cms, widgetDialog);
        Map<String, String> config = CmsStringUtil.splitAsMap(configString, "|", "=");
        // get the list of group names to show
        String groups = config.get(CONFIGURATION_GROUPS);
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(groups)) {
            m_groupNames = CmsStringUtil.splitAsList(groups, ',', true);
        }
        // get the regular expression to filter the groups
        String filter = config.get(CONFIGURATION_GROUPFILTER);
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
            try {
                m_groupFilter = Pattern.compile(filter);
            } catch (PatternSyntaxException e) {
                // log pattern syntax errors
                LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_WIDGET_SELECTGROUP_PATTERN_1, filter));
            }
        }
        // get the OU to read the groups from
        m_ouFqn = config.get(CONFIGURATION_OUFQN);
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_ouFqn)) {
            m_ouFqn = "";
        } else if (!m_ouFqn.endsWith(CmsOrganizationalUnit.SEPARATOR)) {
            m_ouFqn += CmsOrganizationalUnit.SEPARATOR;
        }
        // set the flag to include sub OUs
        m_includeSubOus = Boolean.parseBoolean(config.get(CONFIGURATION_INCLUDESUBOUS));
        m_defaultAllAvailable = Boolean.parseBoolean(config.get(CONFIGURATION_DEFAULT_ALL));
    }