|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.weborganic.bastille.util.Errors
public final class Errors
A utility class for handling error situations in generators.
Method Summary | |
---|---|
static void |
error(ContentRequest req,
XMLWriter xml,
String type,
String message,
ContentStatus status)
Write the XML for when an error occurs |
static void |
invalidParameter(ContentRequest req,
XMLWriter xml,
String name)
Write the XML for when a required parameter is missing. |
static void |
noParameter(ContentRequest req,
XMLWriter xml,
String name)
Write the XML for when a required parameter is missing. |
static void |
noUser(ContentRequest req,
XMLWriter xml)
Write the XML for when the user has not logged in, but is required. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void noParameter(ContentRequest req, XMLWriter xml, String name) throws IOException
Also sets the status of the response to 'bad request'.
Generator should generally terminate after invoking this method.
req
- The content requestxml
- The XML writername
- The name of the missing parameter
IOException
- Should any error occur while writing the XML.
NullPointerException
- If Any argument is null
.public static void invalidParameter(ContentRequest req, XMLWriter xml, String name) throws IOException
Also sets the status of the response to 'bad request'.
Generator should generally terminate after invoking this method.
req
- The content requestxml
- The XML writername
- The name of the invalid parameter
IOException
- Should any error occur while writing the XML.
NullPointerException
- If Any argument is null
.public static void noUser(ContentRequest req, XMLWriter xml) throws IOException
Also sets the status of the response to 'forbidden'.
Generator should generally terminate after invoking this method.
req
- The content request.xml
- The XML writer.
IOException
- Should any error occur while writing the XML.
NullPointerException
- If Any argument is null
.public static void error(ContentRequest req, XMLWriter xml, String type, String message, ContentStatus status) throws IOException
Also sets the status of the response.
Generator should generally terminate after invoking this method.
req
- The content request.xml
- The XML writer.type
- The type of error.message
- The message to explain the error.status
- The new status of the request.
IOException
- Should any error occur while writing the XML.
NullPointerException
- If Any argument is null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |