Package com.iizix.ws.engine
Interface IReplyContent
public interface IReplyContent
Interface for processing of the reply content.
- Author:
- Christopher Mindus
- 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 format) Gets the raw text data from the reply.- 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.
- Method Details- getAcceptedContentString getAcceptedContent()Gets the accepted contents.- Returns:
- A String such as "text/html" or "text/plain, text/html".
 
- isHandledChecks if a content type is handled by this reply.- Parameters:
- type- The content type from the HTTP header "Content-Type", without "charset".
- Returns:
- true if handled, false otherwise.
 
- readReplyCalled to format the request for this reply content, i.e. the accepted content.- Parameters:
- reply- The reply instance.
- data- The String data from the reply.
- Throws:
- IOException- For I/O errors.
 
- canFormatboolean canFormat()Checks if formatting the output is supported.- Returns:
- true If formatting is supported.
 
- getDescriptionString getDescription()Gets the format description.- Returns:
- The description string.
 
- formatHTTPReplyString formatHTTPReply()Formats the URLConnection HTTP headers reply into a String.- Returns:
- The formatted HTML reply string.
 
- getRawOutputGets the raw text data from the reply.- Parameters:
- format- Flag to format the output (used for JSON and XML).
- Returns:
- The String of the reply, or null if an exception occurred.