org.rhq.helpers.bundleGen
Class XmlQuestionsReader

java.lang.Object
  extended by org.rhq.helpers.bundleGen.XmlQuestionsReader

public class XmlQuestionsReader
extends Object

Reads questions from an XML file and shows them to the user. The reader first tries to load a locale based version of the questions (file.<locale>.xml) if this fails, it falls back to using a default version (file.xml)

Author:
Heiko W. Rupp

Constructor Summary
XmlQuestionsReader(String fileBaseName)
          Create a new XmlQuestionReader
 
Method Summary
 void readQuestions(BufferedReader reader, Props props)
          Present the questions to the user and read answers from the provided reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlQuestionsReader

public XmlQuestionsReader(String fileBaseName)
Create a new XmlQuestionReader

Parameters:
fileBaseName - the basename of a file - sans .xml suffix!
Method Detail

readQuestions

public void readQuestions(BufferedReader reader,
                          Props props)
                   throws Exception
Present the questions to the user and read answers from the provided reader.

Parameters:
reader - Buffered Reader to read from. Usually an InputStreamReader(System.in)
props - Props object to fill the answers into.
Throws:
FileNotFoundException - if no question file is found
Exception - On various other occasions


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.