|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.craftforge.essential.supply.Producer
public class Producer
Provides an implementation of the Controllable interface in a view setup.
| Field Summary | |
|---|---|
protected Configuration |
config
The configuration |
| Constructor Summary | |
|---|---|
Producer(Configuration config)
Constructs the producer by supplying the controller configuration. |
|
| Method Summary | |
|---|---|
String |
getBestMatchingMediaType(String accepted)
|
void |
plain(Object result,
OutputStream out,
String charset)
Serializes the result object to plain text, using the specified character encoding. |
void |
produce(String accepted,
Object result,
OutputStream outputStream,
String charset)
Produces the given result object, serializing to the given media type and streaming it using the specified output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Configuration config
| Constructor Detail |
|---|
public Producer(Configuration config)
config - The configuration| Method Detail |
|---|
public void produce(String accepted,
Object result,
OutputStream outputStream,
String charset)
throws ControllerException
accepted - The comma separated enumeration of accepted media typesresult - The result object to serializeoutputStream - The output streamcharset - The charset encoding
ControllerException - if the production process fails
public String getBestMatchingMediaType(String accepted)
throws ControllerException
ControllerException
public void plain(Object result,
OutputStream out,
String charset)
throws IOException
result - The resultout - The output streamcharset - The character encoding
IOException - Failed to initialize the writer for the output stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||