Package com.iizix.ws.engine
Class TextReply
java.lang.Object
com.iizix.ws.engine.TextReply
- All Implemented Interfaces:
- IReplyContent
Class for a "text/*" reply used for plain or HTML text.
- Author:
- Christopher Mindus
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- booleanChecks if formatting the output is supported.Formats the URLConnection HTTP headers reply into a String.Gets the accepted contents.Gets the format description.- getRawOutput- (boolean doFormat) Gets the raw text data from the reply.Gets the reply data.- getType()Gets the accepted type.- booleanChecks if a content type is handled by this reply.- void- readReply- (RESTfulReply reply, String data) Called to format the request for this reply content, i.e.
- Constructor Details- TextReplypublic TextReply- (boolean isPlain) Constructs the text reply for Plain or HTML format.- Parameters:
- isPlain- true for plain string, false for HTML.
 
 
- Method Details- getAcceptedContentGets the accepted contents.- Specified by:
- getAcceptedContentin interface- IReplyContent
- Returns:
- A String such as "text/html" or "text/plain, text/html".
 
- isHandledChecks if a content type is handled by this reply.- Specified by:
- isHandledin interface- IReplyContent
- Parameters:
- type- The content type from the HTTP header "Content-Type", without "charset". The type is in lower case.
- Returns:
- true if handled, false otherwise.
 
- getTypeGets the accepted type.- Returns:
- The type "text/...".
 
- readReplyCalled to format the request for this reply content, i.e. the accepted content.- Specified by:
- readReplyin interface- IReplyContent
- Parameters:
- reply- The reply instance.
- data- The String data from the reply.
 
- getReplyDataGets the reply data.- Returns:
- The raw reply unparsed data.
 
- canFormatpublic boolean canFormat()Checks if formatting the output is supported.- Specified by:
- canFormatin interface- IReplyContent
- Returns:
- true If formatting is supported.
 
- getDescriptionGets the format description.- Specified by:
- getDescriptionin interface- IReplyContent
- Returns:
- The description string.
 
- formatHTTPReplyFormats the URLConnection HTTP headers reply into a String.- Specified by:
- formatHTTPReplyin interface- IReplyContent
- Returns:
- The formatted HTML reply string.
 
- getRawOutputGets the raw text data from the reply.- Specified by:
- getRawOutputin interface- IReplyContent
- Parameters:
- doFormat- Flag to format the output (used for JSON and XML).
- Returns:
- The String of the reply, or null if an exception occurred.