|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| XmlView.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 | /** | |
| 2 | * Licensed under the Artistic License; you may not use this file | |
| 3 | * except in compliance with the License. | |
| 4 | * You may obtain a copy of the License at | |
| 5 | * | |
| 6 | * http://displaytag.sourceforge.net/license.html | |
| 7 | * | |
| 8 | * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR | |
| 9 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
| 10 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
| 11 | */ | |
| 12 | package org.displaytag.export; | |
| 13 | ||
| 14 | import org.apache.commons.lang.StringEscapeUtils; | |
| 15 | import org.displaytag.model.TableModel; | |
| 16 | ||
| 17 | ||
| 18 | /** | |
| 19 | * Export view for xml exporting. | |
| 20 | * @author Fabrizio Giustina | |
| 21 | * @version $Revision: 1081 $ ($Author: fgiust $) | |
| 22 | */ | |
| 23 | public class XmlView extends BaseExportView | |
| 24 | { | |
| 25 | ||
| 26 | /** | |
| 27 | * @see org.displaytag.export.BaseExportView#setParameters(TableModel, boolean, boolean, boolean) | |
| 28 | */ | |
| 29 | 18 | public void setParameters(TableModel tableModel, boolean exportFullList, boolean includeHeader, |
| 30 | boolean decorateValues) | |
| 31 | { | |
| 32 | 18 | super.setParameters(tableModel, exportFullList, includeHeader, decorateValues); |
| 33 | } | |
| 34 | ||
| 35 | /** | |
| 36 | * @see org.displaytag.export.BaseExportView#getRowStart() | |
| 37 | */ | |
| 38 | 16 | protected String getRowStart() |
| 39 | { | |
| 40 | 16 | return "<row>\n"; //$NON-NLS-1$ |
| 41 | } | |
| 42 | ||
| 43 | /** | |
| 44 | * @see org.displaytag.export.BaseExportView#getRowEnd() | |
| 45 | */ | |
| 46 | 16 | protected String getRowEnd() |
| 47 | { | |
| 48 | 16 | return "</row>\n"; //$NON-NLS-1$ |
| 49 | } | |
| 50 | ||
| 51 | /** | |
| 52 | * @see org.displaytag.export.BaseExportView#getCellStart() | |
| 53 | */ | |
| 54 | 16 | protected String getCellStart() |
| 55 | { | |
| 56 | 16 | return "<column>"; //$NON-NLS-1$ |
| 57 | } | |
| 58 | ||
| 59 | /** | |
| 60 | * @see org.displaytag.export.BaseExportView#getCellEnd() | |
| 61 | */ | |
| 62 | 16 | protected String getCellEnd() |
| 63 | { | |
| 64 | 16 | return "</column>\n"; //$NON-NLS-1$ |
| 65 | } | |
| 66 | ||
| 67 | /** | |
| 68 | * @see org.displaytag.export.BaseExportView#getDocumentStart() | |
| 69 | */ | |
| 70 | 16 | protected String getDocumentStart() |
| 71 | { | |
| 72 | 16 | return "<?xml version=\"1.0\"?>\n<table>\n"; //$NON-NLS-1$ |
| 73 | } | |
| 74 | ||
| 75 | /** | |
| 76 | * @see org.displaytag.export.BaseExportView#getDocumentEnd() | |
| 77 | */ | |
| 78 | 16 | protected String getDocumentEnd() |
| 79 | { | |
| 80 | 16 | return "</table>\n"; //$NON-NLS-1$ |
| 81 | } | |
| 82 | ||
| 83 | /** | |
| 84 | * @see org.displaytag.export.BaseExportView#getAlwaysAppendCellEnd() | |
| 85 | */ | |
| 86 | 16 | protected boolean getAlwaysAppendCellEnd() |
| 87 | { | |
| 88 | 16 | return true; |
| 89 | } | |
| 90 | ||
| 91 | /** | |
| 92 | * @see org.displaytag.export.BaseExportView#getAlwaysAppendRowEnd() | |
| 93 | */ | |
| 94 | 16 | protected boolean getAlwaysAppendRowEnd() |
| 95 | { | |
| 96 | 16 | return true; |
| 97 | } | |
| 98 | ||
| 99 | /** | |
| 100 | * @see org.displaytag.export.ExportView#getMimeType() | |
| 101 | */ | |
| 102 | 18 | public String getMimeType() |
| 103 | { | |
| 104 | 18 | return "text/xml"; //$NON-NLS-1$ |
| 105 | } | |
| 106 | ||
| 107 | /** | |
| 108 | * @see org.displaytag.export.BaseExportView#escapeColumnValue(java.lang.Object) | |
| 109 | */ | |
| 110 | 62 | protected String escapeColumnValue(Object value) |
| 111 | { | |
| 112 | 62 | return StringEscapeUtils.escapeXml(value.toString()); |
| 113 | } | |
| 114 | ||
| 115 | } |
|
||||||||||