String description = property.getDescription();
boolean disableUrlEncoding = property.isDisableUrlEncoding();
config.removeParameter( ix );
RestParameterConfig propertyConfig = null;
if( targetIndex < properties.size() )
{
properties.add( targetIndex, properties.remove( ix ) );
propertyConfig = config.insertNewParameter( targetIndex );
}
else
{
properties.add( properties.remove( ix ) );
propertyConfig = config.addNewParameter();
}
propertyConfig.setName( propertyName );
propertyConfig.setValue( value );
propertyConfig.setDefault( defaultValue );
propertyConfig.setStyle( RestParameterConfig.Style.Enum.forString( style ) );
propertyConfig.setOptionArray( options );
propertyConfig.setRequired( required );
propertyConfig.setType( type );
propertyConfig.setDescription( description );
propertyConfig.setDisableUrlEncoding( disableUrlEncoding );
resetPropertiesConfig( config );
if( targetIndex > properties.size() )
targetIndex = properties.size();