1 12 package org.displaytag.export; 13 14 import org.apache.commons.lang.StringEscapeUtils; 15 import org.displaytag.model.TableModel; 16 17 18 23 public class XmlView extends BaseExportView 24 { 25 26 29 public void setParameters(TableModel tableModel, boolean exportFullList, boolean includeHeader, 30 boolean decorateValues) 31 { 32 super.setParameters(tableModel, exportFullList, includeHeader, decorateValues); 33 } 34 35 38 protected String getRowStart() 39 { 40 return "<row>\n"; } 42 43 46 protected String getRowEnd() 47 { 48 return "</row>\n"; } 50 51 54 protected String getCellStart() 55 { 56 return "<column>"; } 58 59 62 protected String getCellEnd() 63 { 64 return "</column>\n"; } 66 67 70 protected String getDocumentStart() 71 { 72 return "<?xml version=\"1.0\"?>\n<table>\n"; } 74 75 78 protected String getDocumentEnd() 79 { 80 return "</table>\n"; } 82 83 86 protected boolean getAlwaysAppendCellEnd() 87 { 88 return true; 89 } 90 91 94 protected boolean getAlwaysAppendRowEnd() 95 { 96 return true; 97 } 98 99 102 public String getMimeType() 103 { 104 return "text/xml"; } 106 107 110 protected String escapeColumnValue(Object value) 111 { 112 return StringEscapeUtils.escapeXml(value.toString()); 113 } 114 115 } | Popular Tags |