Java Code Examples for org.apache.commons.configuration2.ConfigurationConverter#getConfiguration()

The following examples show how to use org.apache.commons.configuration2.ConfigurationConverter#getConfiguration() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReadPropertiesStepExecution.java    From pipeline-utility-steps-plugin with MIT License 6 votes vote down vote up
/**
 * Using commons collection to interpolated the values inside the properties
 * @param properties the list of properties to be interpolated
 * @return a new Properties object with the interpolated values
 */
private Properties interpolateProperties(Properties properties) throws Exception {
    if ( properties == null)
        return null;
    Configuration interpolatedProp;
    PrintStream logger = getLogger();
    try {
        // Convert the Properties to a Configuration object in order to apply the interpolation
        Configuration conf = ConfigurationConverter.getConfiguration(properties);

        // Apply interpolation
        interpolatedProp = ((AbstractConfiguration)conf).interpolatedConfiguration();
    } catch (Exception e) {
        logger.println("Got exception while interpolating the variables: " + e.getMessage());
        logger.println("Returning the original properties list!");
        return properties;
    }

    // Convert back to properties
    return ConfigurationConverter.getProperties(interpolatedProp);
}
 
Example 2
Source File: OpenAPI2MarkupConfigBuilder.java    From swagger2markup with Apache License 2.0 4 votes vote down vote up
public OpenAPI2MarkupConfigBuilder(Properties properties) {
    this(ConfigurationConverter.getConfiguration(properties));
}
 
Example 3
Source File: Swagger2MarkupConfigBuilder.java    From swagger2markup with Apache License 2.0 4 votes vote down vote up
public Swagger2MarkupConfigBuilder(Properties properties) {
    this(ConfigurationConverter.getConfiguration(properties));
}
 
Example 4
Source File: Schema2MarkupProperties.java    From swagger2markup with Apache License 2.0 4 votes vote down vote up
public Schema2MarkupProperties(Properties properties) {
    this(ConfigurationConverter.getConfiguration(properties));
}