String prefix = getPlaceholderProperty(metadata, "placeholderPrefix");
String suffix = getPlaceholderProperty(metadata, "placeholderSuffix");
for (String id : registry.getComponentDefinitionNames()) {
ComponentMetadata component = registry.getComponentDefinition(id);
if (component instanceof ExtendedBeanMetadata) {
ExtendedBeanMetadata bean = (ExtendedBeanMetadata) component;
if (bean.getRuntimeClass() != null && AbstractPropertyPlaceholder.class.isAssignableFrom(bean.getRuntimeClass())) {
String otherPrefix = getPlaceholderProperty(bean, "placeholderPrefix");
String otherSuffix = getPlaceholderProperty(bean, "placeholderSuffix");
if (prefix.equals(otherPrefix) && suffix.equals(otherSuffix)) {
throw new ComponentDefinitionException("Multiple placeholders with the same prefix and suffix are not allowed");
}