Package com.iizix.ws.engine
Interface IReplyContent
public interface IReplyContent
Interface for processing of the reply content.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks 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.boolean
Checks 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
getAcceptedContent
String getAcceptedContent()Gets the accepted contents.- Returns:
- A String such as "text/html" or "text/plain, text/html".
isHandled
Checks 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.
readReply
Called 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.
canFormat
boolean canFormat()Checks if formatting the output is supported.- Returns:
- true If formatting is supported.
getDescription
String getDescription()Gets the format description.- Returns:
- The description string.
formatHTTPReply
String formatHTTPReply()Formats the URLConnection HTTP headers reply into a String.- Returns:
- The formatted HTML reply string.
getRawOutput
Gets 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.