protected String parseResolvablePropString(String unparsedString,PropertyResolver resolver,Set<String> visitedReplaceableStrings){
  StringBuilder buf=new StringBuilder(unparsedString);
  int prefixIndex=buf.indexOf(propertyPrefix);
  while (prefixIndex != -1) {
    int suffixIndex=findSuffixIndex(buf,prefixIndex + propertyPrefix.length());
    if (suffixIndex != -1) {
      String replaceableString=buf.substring(prefixIndex + propertyPrefix.length(),suffixIndex);
      if (!visitedReplaceableStrings.add(replaceableString)) {
        logger.info(LocalizedMessage.create(LocalizedStrings.CacheXmlPropertyResolverHelper_SOME_UNRESOLVED_STRING_REPLACED_CIRCULAR_ERROR__0,replaceableString));
        throw new IllegalArgumentException("Some still unresolved string " + replaceableString + " was replaced by resolver, leading to circular references.");
      }
      replaceableString=parseResolvablePropString(replaceableString,resolver,visitedReplaceableStrings);
      String replacement=resolver.resolveReplaceString(replaceableString);
      if (replacement != null) {
        replacement=parseResolvablePropString(replacement,resolver,visitedReplaceableStrings);
        buf.replace(prefixIndex,suffixIndex + propertySuffix.length(),replacement);
        prefixIndex=buf.indexOf(propertyPrefix,prefixIndex + replacement.length());
      }
 else       if (resolver.isIgnoreUnresolvedProperties()) {
        prefixIndex=buf.indexOf(propertyPrefix,suffixIndex + propertySuffix.length());
      }
 else {
        throw new IllegalArgumentException("No replacement found for property : " + replaceableString);
      }
      visitedReplaceableStrings.remove(replaceableString);
    }
 else {
      prefixIndex=-1;
    }
  }
  return buf.toString();
}

protected String parseResolvablePropString ( String unparsedString , PropertyResolver resolver , Set < String > visitedReplaceableStrings ) { StringBuilder buf = new StringBuilder ( unparsedString ) ; int prefixIndex = buf . indexOf ( propertyPrefix ) ; while ( prefixIndex != - 1 ) { int suffixIndex = findSuffixIndex ( buf , prefixIndex + propertyPrefix . length ( ) ) ; if ( suffixIndex != - 1 ) { String replaceableString = buf . substring ( prefixIndex + propertyPrefix . length ( ) , suffixIndex ) ; if ( ! visitedReplaceableStrings . add ( replaceableString ) ) { logger . info ( LocalizedMessage . create ( LocalizedStrings . CacheXmlPropertyResolverHelper_SOME_UNRESOLVED_STRING_REPLACED_CIRCULAR_ERROR__0 , replaceableString ) ) ; throw new IllegalArgumentException ( "Some still unresolved string " + replaceableString + " was replaced by resolver, leading to circular references." ) ; } replaceableString = parseResolvablePropString ( replaceableString , resolver , visitedReplaceableStrings ) ; String replacement = resolver . resolveReplaceString ( replaceableString ) ; if ( replacement != null ) { replacement = parseResolvablePropString ( replacement , resolver , visitedReplaceableStrings ) ; buf . replace ( prefixIndex , suffixIndex + propertySuffix . length ( ) , replacement ) ; prefixIndex = buf . indexOf ( propertyPrefix , prefixIndex + replacement . length ( ) ) ; } else if ( resolver . isIgnoreUnresolvedProperties ( ) ) { prefixIndex = buf . indexOf ( propertyPrefix , suffixIndex + propertySuffix . length ( ) ) ; } else { throw new IllegalArgumentException ( "No replacement found for property : " + replaceableString ) ; } visitedReplaceableStrings . remove ( replaceableString ) ; } else { prefixIndex = - 1 ; } } return buf . toString ( ) ; }
parses the given string which are supposed to be like $ { } for system and / or gemfire properties to be replaced . this will return property . name from $ { property . name } .
