|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.httpd.Formatter
public class Formatter
This class is a helper class to handle the formatting strings written either as an HTTP response, or to stdout, or to stderr.
| Field Summary | |
|---|---|
static boolean |
DEBUG
Debug flag reserved for midium level of stdout vebrocity. |
static boolean |
DEBUG_VERBOSE
Debug flag reserver for a higher level of stdout vebrocity. |
static boolean |
ECHO
Flag for debugging an input stream. |
static int |
READ_AHEAD
Size to be used in marking an input stream. |
| Constructor Summary | |
|---|---|
Formatter()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
createPvFormat(HttpConstant param,
HttpConstant value)
Overloaded helper method for creating a HTTP proper response for a param value pair. |
static java.lang.String |
createPvFormat(HttpConstant param,
int value)
Overloaded helper method for creating a HTTP proper response for a param value pair. |
static java.lang.String |
createStatusLine(HttpConstant statusId,
java.lang.String msg)
Helper method for creating a properly formatted status line for the response. |
static void |
printToErrLn(java.lang.Class caller,
java.lang.String methodName,
java.lang.String msg,
java.lang.String data)
Helper method that prints to the stderr details about a failure. |
static void |
printToOutLn(java.lang.String msg)
Helper method that prints to stdout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
public static final boolean DEBUG_VERBOSE
public static final boolean ECHO
public static final int READ_AHEAD
| Constructor Detail |
|---|
public Formatter()
| Method Detail |
|---|
public static java.lang.String createPvFormat(HttpConstant param,
HttpConstant value)
param - The HTTP parameter namevalue - The Http parameter value
public static java.lang.String createPvFormat(HttpConstant param,
int value)
param - The HTTP parameter namevalue - The Http parameter value
public static java.lang.String createStatusLine(HttpConstant statusId,
java.lang.String msg)
statusId - The ID of the status e.g. 408 for request time outmsg - A short description of the status
public static void printToOutLn(java.lang.String msg)
msg - The msg to print
public static void printToErrLn(java.lang.Class caller,
java.lang.String methodName,
java.lang.String msg,
java.lang.String data)
caller - The class that produced the errormethodName - The method name of the class where the error originatedmsg - A shortdescription of the errordata - The offending data if any
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||