public class TextReply extends Object implements IReplyContent
Constructor and Description |
---|
TextReply(boolean isPlain)
Constructs the text reply for Plain or HTML format.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canFormat()
Checks if formatting the output is supported.
|
String |
formatHTTPReply()
Formats the URLConnection HTTP headers reply into a String.
|
String |
getAcceptedContent()
Gets the accepted contents.
|
String |
getDescription()
Gets the format description.
|
String |
getRawOutput(boolean doFormat)
Gets the raw text data from the reply.
|
String |
getReplyData()
Gets the reply data.
|
String |
getType()
Gets the accepted type.
|
boolean |
isHandled(String type)
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.
|
public TextReply(boolean isPlain)
isPlain
- true for plain string, false for HTML.public String getAcceptedContent()
getAcceptedContent
in interface IReplyContent
public boolean isHandled(String type)
isHandled
in interface IReplyContent
type
- The content type from the HTTP header "Content-Type", without "charset".
The type is in lower case.public String getType()
public void readReply(RESTfulReply reply, String data)
readReply
in interface IReplyContent
reply
- The reply instance.data
- The String data from the reply.public String getReplyData()
public boolean canFormat()
canFormat
in interface IReplyContent
public String getDescription()
getDescription
in interface IReplyContent
public String formatHTTPReply()
formatHTTPReply
in interface IReplyContent
public String getRawOutput(boolean doFormat)
getRawOutput
in interface IReplyContent
doFormat
- Flag to format the output (used for JSON and XML).iizi® is a registered trademark of Mindus SARL. © Copyright 2019 Mindus SARL. All rights reserved.