public abstract class TemplateFileHandler extends Object
Modifier and Type | Field and Description |
---|---|
static processing.core.PApplet |
parent |
Constructor and Description |
---|
TemplateFileHandler(String templateFileName) |
Modifier and Type | Method and Description |
---|---|
void |
addVariable(String lookupName,
Object value)
Use this method to add variables to the data model.
|
abstract void |
createMap()
This method should be overwritten in order to create a data model for the template
by using the the addVariable function
|
com.sun.net.httpserver.HttpExchange |
getExchange() |
void |
handle(com.sun.net.httpserver.HttpExchange exchange) |
Map<String,String> |
queryToMap()
get the query parameters of the recent exchange as map of fields as keys and values
e.g.
|
String |
toString() |
public TemplateFileHandler(String templateFileName)
public abstract void createMap()
public void addVariable(String lookupName, Object value)
lookupName
- names in the templatevalue
- value the name is replaces with in the template
any of String,Number,Boolean,List,Mappublic void handle(com.sun.net.httpserver.HttpExchange exchange) throws IOException
IOException
public Map<String,String> queryToMap()
public com.sun.net.httpserver.HttpExchange getExchange()
Processing library SimpleHTTPServer by Ramin Soleymani. (c) 2016