toolbox.confgen
Class ConfHelper

Package class diagram package ConfHelper
java.lang.Object
  extended by toolbox.confgen.ConfHelper

public class ConfHelper
extends java.lang.Object

Helper class to handle IO events for ConfModule implementations.


Constructor Summary
ConfHelper()
           
 
Method Summary
static void populateTemplateModel(freemarker.template.SimpleHash root, java.util.Properties props)
          Populate the given hash with the values from the given properties instance.
static void read(java.io.BufferedReader reader, java.lang.String key, java.util.Properties props, java.io.PrintWriter writer, java.lang.String question, boolean required)
          Read a line of input from the given reader and place the input in the given Properties instance using the provided key.
static void write(java.lang.String question, boolean required, java.io.PrintWriter writer)
          Write the given question to the given writer
static void writeQuestionHelp(java.io.PrintWriter writer)
          Print a help message regarding questions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfHelper

public ConfHelper()
Method Detail

writeQuestionHelp

public static void writeQuestionHelp(java.io.PrintWriter writer)
                              throws java.io.IOException
Print a help message regarding questions.

Parameters:
writer - Use this writer to print the message.
Throws:
java.io.IOException

write

public static void write(java.lang.String question,
                         boolean required,
                         java.io.PrintWriter writer)
                  throws java.io.IOException
Write the given question to the given writer

Parameters:
question - The question.
required - boolean indicating whether the question requires an answer.
writer - The writer
Throws:
java.io.IOException

read

public static void read(java.io.BufferedReader reader,
                        java.lang.String key,
                        java.util.Properties props,
                        java.io.PrintWriter writer,
                        java.lang.String question,
                        boolean required)
                 throws java.io.IOException
Read a line of input from the given reader and place the input in the given Properties instance using the provided key.

Parameters:
reader - Read a line of text from this reader.
key - Property name.
props - Properties instance.
Throws:
java.io.IOException

populateTemplateModel

public static void populateTemplateModel(freemarker.template.SimpleHash root,
                                         java.util.Properties props)
Populate the given hash with the values from the given properties instance.

Parameters:
root - Template model root.
props - Properties instance.