/** * Creates a new instance of {@code DefaultConfigurationKey} and sets * the associated expression engine and an initial key. * * @param engine the expression engine * @param key the key to be wrapped */ public DefaultConfigurationKey(DefaultExpressionEngine engine, String key) { setExpressionEngine(engine); keyBuffer = new StringBuilder(trim(key)); }
/** * Creates a new instance of {@code DefaultConfigurationKey} and sets * the associated expression engine and an initial key. * * @param engine the expression engine * @param key the key to be wrapped */ public DefaultConfigurationKey(DefaultExpressionEngine engine, String key) { setExpressionEngine(engine); keyBuffer = new StringBuilder(trim(key)); }
/** * Appends the name of a property to this key. If necessary, a property * delimiter will be added. If the boolean argument is set to <b>true</b>, * property delimiters contained in the property name will be escaped. * * @param property the name of the property to be added * @param escape a flag if property delimiters in the passed in property name * should be escaped * @return a reference to this object */ public DefaultConfigurationKey append(String property, boolean escape) { String key; if (escape && property != null) { key = escapeDelimiters(property); } else { key = property; } key = trim(key); if (keyBuffer.length() > 0 && !isAttributeKey(property) && key.length() > 0) { keyBuffer.append(getExpressionEngine().getPropertyDelimiter()); } keyBuffer.append(key); return this; }
/** * Appends the name of a property to this key. If necessary, a property * delimiter will be added. If the boolean argument is set to <b>true</b>, * property delimiters contained in the property name will be escaped. * * @param property the name of the property to be added * @param escape a flag if property delimiters in the passed in property name * should be escaped * @return a reference to this object */ public DefaultConfigurationKey append(String property, boolean escape) { String key; if (escape && property != null) { key = escapeDelimiters(property); } else { key = property; } key = trim(key); if (keyBuffer.length() > 0 && !isAttributeKey(property) && key.length() > 0) { keyBuffer.append(getExpressionEngine().getPropertyDelimiter()); } keyBuffer.append(key); return this; }