Package jodd.props

Class PropertiesToProps


  • class PropertiesToProps
    extends java.lang.Object
    Converter for Java Properties to Jodd Props format.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void convertToWriter​(java.io.Writer writer, java.util.Properties properties, java.util.Map<java.lang.String,​java.util.Properties> profiles)
      Convert Java Properties to Jodd Props format
      private java.io.BufferedWriter getBufferedWriter​(java.io.Writer writer)  
      private void writeBaseAndProfileProperties​(java.io.BufferedWriter bw, java.util.Properties baseProperties, java.util.Map<java.lang.String,​java.util.Properties> profiles)  
      private void writeBaseProperty​(java.io.BufferedWriter bw, java.lang.String key, java.lang.String value)  
      private void writeProfilePropertiesOfKey​(java.io.BufferedWriter bw, java.lang.String key, java.util.Map<java.lang.String,​java.util.Properties> profiles)  
      private void writeProfilePropertiesThatAreNotInTheBase​(java.io.BufferedWriter bw, java.util.Properties baseProperties, java.util.Map<java.lang.String,​java.util.Properties> profiles)  
      private void writeProfileProperty​(java.io.BufferedWriter bw, java.lang.String profileName, java.lang.String key, java.lang.String value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertiesToProps

        PropertiesToProps()
    • Method Detail

      • convertToWriter

        void convertToWriter​(java.io.Writer writer,
                             java.util.Properties properties,
                             java.util.Map<java.lang.String,​java.util.Properties> profiles)
                      throws java.io.IOException
        Convert Java Properties to Jodd Props format
        Parameters:
        writer - Writer to write Props formatted file content to
        properties - Properties to convert to Props format
        profiles - Properties per profile to convert and add to the Props format
        Throws:
        java.io.IOException - On any I/O error when writing to the writer
      • writeProfilePropertiesThatAreNotInTheBase

        private void writeProfilePropertiesThatAreNotInTheBase​(java.io.BufferedWriter bw,
                                                               java.util.Properties baseProperties,
                                                               java.util.Map<java.lang.String,​java.util.Properties> profiles)
                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getBufferedWriter

        private java.io.BufferedWriter getBufferedWriter​(java.io.Writer writer)
      • writeBaseAndProfileProperties

        private void writeBaseAndProfileProperties​(java.io.BufferedWriter bw,
                                                   java.util.Properties baseProperties,
                                                   java.util.Map<java.lang.String,​java.util.Properties> profiles)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeProfilePropertiesOfKey

        private void writeProfilePropertiesOfKey​(java.io.BufferedWriter bw,
                                                 java.lang.String key,
                                                 java.util.Map<java.lang.String,​java.util.Properties> profiles)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeProfileProperty

        private void writeProfileProperty​(java.io.BufferedWriter bw,
                                          java.lang.String profileName,
                                          java.lang.String key,
                                          java.lang.String value)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • writeBaseProperty

        private void writeBaseProperty​(java.io.BufferedWriter bw,
                                       java.lang.String key,
                                       java.lang.String value)
                                throws java.io.IOException
        Throws:
        java.io.IOException