blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholderExt.java [402:492]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        .append(" at location ");
        
        for(String s : processingStack) {
            sb.append(s);
        }
        
        sb.append(". This may prevent properties, beans, or other items referenced by this component from being properly processed.");
        
        LOGGER.info(sb.toString());
    }
    
    protected Object retrieveValue(String expression) {
        return getProperty(expression);
    }
    
    protected Object processString(String str) {
        // TODO: we need to handle escapes on the prefix / suffix
        Matcher matcher = getPattern().matcher(str);
        while (matcher.find()) {
            String n = matcher.group(1);
            int idx = n.indexOf(placeholderPrefix);
            if (idx >= 0) {
                matcher.region(matcher.start(1) + idx, str.length());
                continue;
            }
            Object rep = retrieveValue(matcher.group(1));
            if (rep != null) {
                if (rep instanceof String || !matcher.group(0).equals(str)) {
                    str = str.replace(matcher.group(0), rep.toString());
                    matcher.reset(str);
                } else {
                    return rep;
                }
            }
        }
        if (nullValue != null && nullValue.equals(str)) {
            return null;
        }
        return str;
    }

    protected Object getProperty(String val) {
        return null;
    }

    protected Pattern getPattern() {
        if (pattern == null) {
            pattern = Pattern.compile("\\Q" + placeholderPrefix + "\\E(.+?)\\Q" + placeholderSuffix + "\\E");
        }
        return pattern;
    }

    public class LateBindingValueMetadata implements ExtendedValueMetadata {

        private final ValueMetadata metadata;
        private boolean retrieved;
        private Object retrievedValue;

        public LateBindingValueMetadata(ValueMetadata metadata) {
            this.metadata = metadata;
        }

        public String getStringValue() {
            retrieve();
            return retrievedValue instanceof String ? (String) retrievedValue : null;
        }

        public String getType() {
            return metadata.getType();
        }

        public Object getValue() {
            retrieve();
            return retrievedValue instanceof String ? null : retrievedValue;
        }

        private void retrieve() {
            if (!retrieved) {
                Object o = null;
                if (metadata instanceof ExtendedValueMetadata) {
                    o = ((ExtendedValueMetadata) metadata).getValue();
                }
                if (o == null) {
                    String v = metadata.getStringValue();
                    LOGGER.debug("Before process: {}", v);
                    retrievedValue = processString(v);
                    LOGGER.debug("After process: {}", retrievedValue);
                } else {
                    LOGGER.debug("Skipping non string value: {}", o);
                }
                retrieved = true;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



blueprint/blueprint-noosgi/src/main/java/org/apache/aries/blueprint/ext/AbstractPropertyPlaceholder.java [312:402]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                .append(" at location ");

        for(String s : processingStack) {
            sb.append(s);
        }

        sb.append(". This may prevent properties, beans, or other items referenced by this component from being properly processed.");

        LOGGER.info(sb.toString());
    }

    protected Object retrieveValue(String expression) {
        return getProperty(expression);
    }

    protected Object processString(String str) {
        // TODO: we need to handle escapes on the prefix / suffix
        Matcher matcher = getPattern().matcher(str);
        while (matcher.find()) {
            String n = matcher.group(1);
            int idx = n.indexOf(placeholderPrefix);
            if (idx >= 0) {
                matcher.region(matcher.start(1) + idx, str.length());
                continue;
            }
            Object rep = retrieveValue(matcher.group(1));
            if (rep != null) {
                if (rep instanceof String || !matcher.group(0).equals(str)) {
                    str = str.replace(matcher.group(0), rep.toString());
                    matcher.reset(str);
                } else {
                    return rep;
                }
            }
        }
        if (nullValue != null && nullValue.equals(str)) {
            return null;
        }
        return str;
    }

    protected Object getProperty(String val) {
        return null;
    }

    protected Pattern getPattern() {
        if (pattern == null) {
            pattern = Pattern.compile("\\Q" + placeholderPrefix + "\\E(.+?)\\Q" + placeholderSuffix + "\\E");
        }
        return pattern;
    }

    public class LateBindingValueMetadata implements ExtendedValueMetadata {

        private final ValueMetadata metadata;
        private boolean retrieved;
        private Object retrievedValue;

        public LateBindingValueMetadata(ValueMetadata metadata) {
            this.metadata = metadata;
        }

        public String getStringValue() {
            retrieve();
            return retrievedValue instanceof String ? (String) retrievedValue : null;
        }

        public String getType() {
            return metadata.getType();
        }

        public Object getValue() {
            retrieve();
            return retrievedValue instanceof String ? null : retrievedValue;
        }

        private void retrieve() {
            if (!retrieved) {
                Object o = null;
                if (metadata instanceof ExtendedValueMetadata) {
                    o = ((ExtendedValueMetadata) metadata).getValue();
                }
                if (o == null) {
                    String v = metadata.getStringValue();
                    LOGGER.debug("Before process: {}", v);
                    retrievedValue = processString(v);
                    LOGGER.debug("After process: {}", retrievedValue);
                } else {
                    LOGGER.debug("Skipping non string value: {}", o);
                }
                retrieved = true;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



