/** * @param stringWithPrefixAndSuffix * @param prefix * @param suffix * @return string */ public String processUnresolvableString(String stringWithPrefixAndSuffix, String prefix, String suffix){ String resolvedString = null; try{ if (helper == null){ helper = new CacheXmlPropertyResolverHelper(prefix, suffix); } /** A <code>resolvedString</code> can be same as <code>stringWithPrefixAndSuffix</code> if * <code>ignoreUnresolvedProperties</code> is set true and we just return it as is. */ resolvedString = helper.parseResolvablePropString(stringWithPrefixAndSuffix, this, new HashSet<String>()); } catch (IllegalArgumentException e) { if(ignoreUnresolvedProperties) { //Do Nothing } else { logger.error(LocalizedMessage.create(LocalizedStrings.CacheXmlPropertyResolver_UNSEROLVAVLE_STRING_FORMAT_ERROR__0, stringWithPrefixAndSuffix)); } } return resolvedString; }
int suffixIndex = findSuffixIndex(buf, prefixIndex+propertyPrefix.length()); if(suffixIndex != -1){ String replaceableString = buf.substring(prefixIndex+propertyPrefix.length(), suffixIndex); if(getLogWriter() != null){ logWriter.info(LocalizedStrings.CacheXmlPropertyResolverHelper_SOME_UNRESOLVED_STRING_REPLACED_CIRCULAR_ERROR__0, replaceableString); replaceableString = parseResolvablePropString(replaceableString, resolver, visitedReplaceableStrings); String replacement = resolver.resolveReplaceString(replaceableString); replacement = parseResolvablePropString(replacement, resolver, visitedReplaceableStrings); buf.replace(prefixIndex, suffixIndex+propertySuffix.length(), replacement); prefixIndex = buf.indexOf(propertyPrefix, prefixIndex+replacement.length());
int suffixIndex = findSuffixIndex(buf, prefixIndex+propertyPrefix.length()); if(suffixIndex != -1){ String replaceableString = buf.substring(prefixIndex+propertyPrefix.length(), suffixIndex); replaceableString = parseResolvablePropString(replaceableString, resolver, visitedReplaceableStrings); String replacement = resolver.resolveReplaceString(replaceableString); replacement = parseResolvablePropString(replacement, resolver, visitedReplaceableStrings); buf.replace(prefixIndex, suffixIndex+propertySuffix.length(), replacement); prefixIndex = buf.indexOf(propertyPrefix, prefixIndex+replacement.length());
/** * @param stringWithPrefixAndSuffix * @param prefix * @param suffix * @return string */ public String processUnresolvableString(String stringWithPrefixAndSuffix, String prefix, String suffix){ String resolvedString = null; try{ if (helper == null){ helper = new CacheXmlPropertyResolverHelper(prefix, suffix); } /** A <code>resolvedString</code> can be same as <code>stringWithPrefixAndSuffix</code> if * <code>ignoreUnresolvedProperties</code> is set true and we just return it as is. */ resolvedString = helper.parseResolvablePropString(stringWithPrefixAndSuffix, this, new HashSet<String>()); } catch (IllegalArgumentException e) { if(ignoreUnresolvedProperties) { //Do Nothing } else { if(getLogWriter() != null) { logWriter.error(LocalizedStrings.CacheXmlPropertyResolver_UNSEROLVAVLE_STRING_FORMAT_ERROR__0, stringWithPrefixAndSuffix); } else { throw e; } } } return resolvedString; }