@Override protected void setConfiguration( Configuration configuration, String[] propertyNameTokens, String propertyValue) { String type = propertyNameTokens[0]; if (BlueprintFactory.PROPERTIES_PROPERTY_ID.equals(propertyNameTokens[1])) { configuration.setProperty(type, propertyNameTokens[2], propertyValue); } else if (BlueprintFactory.PROPERTIES_ATTRIBUTES_PROPERTY_ID.equals(propertyNameTokens[1])) { configuration.setAttribute( type, propertyNameTokens[2], propertyNameTokens[3], propertyValue); } }
private ConfigurationStrategy decidePopulationStrategy(Map<String, String> configuration) { if (configuration != null && !configuration.isEmpty()) { String keyEntry = configuration.keySet().iterator().next(); String[] keyNameTokens = keyEntry.split("/"); int levels = keyNameTokens.length; String propertiesType = keyNameTokens[1]; if (levels == 2) { return new ConfigurationStrategyV1(); } else if ((levels == 3 && BlueprintFactory.PROPERTIES_PROPERTY_ID.equals(propertiesType)) || (levels == 4 && BlueprintFactory.PROPERTIES_ATTRIBUTES_PROPERTY_ID.equals(propertiesType))) { return new ConfigurationStrategyV2(); } else { throw new IllegalArgumentException(SCHEMA_IS_NOT_SUPPORTED_MESSAGE); } } else { return new ConfigurationStrategyV2(); } }