src/main/java/pl/jalokim/propertiestojson/util/PropertiesToJsonConverter.java
public String convertToJson(Properties properties) throws ParsePropertiesException {
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            if (!(entry.getKey() instanceof String)) {
                throw new ParsePropertiesException(format(PROPERTY_KEY_NEEDS_TO_BE_STRING_TYPE,
                                                          entry.getKey().getClass(),
                                                          entry.getKey() == null ? "null" : entry.getKey()));
            }
        }
        return convertFromValuesAsObjectMap(propertiesToMap(properties));
    }
public String convertToJson(Properties properties) throws ParsePropertiesException {
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            if (!(entry.getKey() instanceof String)) {
                throw new ParsePropertiesException(format(PROPERTY_KEY_NEEDS_TO_BE_STRING_TYPE,
                                                          entry.getKey().getClass(),
                                                          entry.getKey() == null ? "null" : entry.getKey()));
            }
        }
        return convertFromValuesAsObjectMap(propertiesToMap(properties));
    }
public String convertToJson ( Properties properties ) throws ParsePropertiesException { for ( Map . Entry < Object , Object > entry : properties . entrySet ( ) ) { if ( ! ( entry . getKey ( ) instanceof String ) ) { throw new ParsePropertiesException ( format ( PROPERTY_KEY_NEEDS_TO_BE_STRING_TYPE , entry . getKey ( ) . getClass ( ) , entry . getKey ( ) == null ? "null" : entry . getKey ( ) ) ) ; } } return convertFromValuesAsObjectMap ( propertiesToMap ( properties ) ) ; }
generate Json by given Java Properties

@param properties Java Properties
@return simple String with json
@throws ParsePropertiesException when structure of properties is not compatible with json structure
generate Json by given Java Properties