.
| Method from com.opensymphony.sitemesh.compatability.Content2HTMLPage Detail: |
public void addProperty(String name,
String value) {
content.addProperty(name, value);
}
|
public String getBody() {
try {
StringWriter writer = new StringWriter();
writeBody(writer);
return writer.toString();
} catch (IOException e) {
throw new IllegalStateException("Could not get body " + e.getMessage());
}
}
|
public boolean getBooleanProperty(String name) {
String property = getProperty(name);
if (property == null || property.trim().length() == 0) return false;
switch (property.charAt(0)) {
case '1":
case 't":
case 'T":
case 'y":
case 'Y":
return true;
default:
return false;
}
}
|
public int getContentLength() {
return content.originalLength();
}
|
public String getHead() {
try {
StringWriter writer = new StringWriter();
writeHead(writer);
return writer.toString();
} catch (IOException e) {
throw new IllegalStateException("Could not get head " + e.getMessage());
}
}
|
public int getIntProperty(String name) {
try {
return Integer.parseInt(noNull(getProperty(name)));
}
catch (NumberFormatException e) {
return 0;
}
}
|
public long getLongProperty(String name) {
try {
return Long.parseLong(noNull(getProperty(name)));
} catch (NumberFormatException e) {
return 0;
}
}
|
public String getPage() {
try {
StringWriter writer = new StringWriter();
writePage(writer);
return writer.toString();
} catch (IOException e) {
throw new IllegalStateException("Could not get page " + e.getMessage());
}
}
|
public Map getProperties() {
Map result = new HashMap();
String[] keys = content.getPropertyKeys();
for (int i = 0; i < keys.length; i++) {
result.put(keys[i], content.getProperty(keys[i]));
}
return result;
}
|
public String getProperty(String name) {
return content.getProperty(name);
}
|
public String[] getPropertyKeys() {
return content.getPropertyKeys();
}
|
public HttpServletRequest getRequest() {
// TODO: Find a new place for the request to live - don't want to couple Content to Servlet environment.
throw new UnsupportedOperationException();
}
|
public String getTitle() {
return content.getTitle();
}
|
public boolean isFrameSet() {
return isPropertySet("frameset") && getProperty("frameset").equalsIgnoreCase("true");
}
|
public boolean isPropertySet(String name) {
return getProperty(name) != null;
}
|
public void setFrameSet(boolean frameset) {
addProperty("frameset", frameset ? "true" : "false");
}
|
public void setRequest(HttpServletRequest request) {
// TODO: Find a new place for the request to live - don't want to couple Content to Servlet environment.
throw new UnsupportedOperationException();
}
|
public void writeBody(Writer out) throws IOException {
content.writeBody(out);
}
|
public void writeHead(Writer out) throws IOException {
content.writeHead(out);
}
|
public void writePage(Writer out) throws IOException {
content.writeOriginal(out);
}
|