|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2012 the original author or authors. |
| 2 | + * Copyright 2002-2014 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
27 | 27 | import org.springframework.util.CollectionUtils;
|
28 | 28 |
|
29 | 29 | /**
|
30 |
| - * Jasper Reports view class that allows for the actual rendering format to be |
31 |
| - * specified at runtime using a parameter contained in the model. |
| 30 | + * Jasper Reports view class that allows for the actual rendering format |
| 31 | + * to be specified at runtime using a parameter contained in the model. |
32 | 32 | *
|
33 | 33 | * <p>This view works on the concept of a format key and a mapping key.
|
34 |
| - * The format key is used to pass the mapping key from your |
35 |
| - * {@code Controller} to Spring through as part of the model and the |
36 |
| - * mapping key is used to map a logical format to an actual JasperReports |
37 |
| - * view class. For example you might add the following code to your |
38 |
| - * {@code Controller}: |
| 34 | + * The format key is used to pass the mapping key from your {@code Controller} |
| 35 | + * to Spring through as part of the model and the mapping key is used to map |
| 36 | + * a logical format to an actual JasperReports view class. |
| 37 | + * |
| 38 | + * <p>For example, you might add the following code to your {@code Controller}: |
39 | 39 | *
|
40 | 40 | * <pre class="code">
|
41 | 41 | * Map<String, Object> model = new HashMap<String, Object>();
|
42 | 42 | * model.put("format", "pdf");</pre>
|
43 | 43 | *
|
44 |
| - * Here {@code format} is the format key and {@code pdf} is |
45 |
| - * the mapping key. When rendering a report, this class looks for a |
46 |
| - * model parameter under the format key, which by default is |
47 |
| - * {@code format}. It then uses the value of this parameter to lookup |
48 |
| - * the actual {@code View} class to use. The default mappings for this |
49 |
| - * lookup are: |
| 44 | + * Here {@code format} is the format key and {@code pdf} is the mapping key. |
| 45 | + * When rendering a report, this class looks for a model parameter under the |
| 46 | + * format key, which by default is {@code format}. It then uses the value of |
| 47 | + * this parameter to lookup the actual {@code View} class to use. |
| 48 | + * |
| 49 | + * <p>The default mappings for the format lookup are: |
50 | 50 | *
|
51 | 51 | * <p><ul>
|
52 | 52 | * <li>{@code csv} - {@code JasperReportsCsvView}</li>
|
|
55 | 55 | * <li>{@code xls} - {@code JasperReportsXlsView}</li>
|
56 | 56 | * </ul>
|
57 | 57 | *
|
58 |
| - * <p>The format key can be changed using the {@code formatKey} |
59 |
| - * property and the mapping key to view class mappings can be changed using the |
| 58 | + * <p>The format key can be changed using the {@code formatKey} property. |
| 59 | + * The applicable key-to-view-class mappings can be configured using the |
60 | 60 | * {@code formatMappings} property.
|
61 | 61 | *
|
62 | 62 | * @author Rob Harrop
|
@@ -102,6 +102,7 @@ public JasperReportsMultiFormatView() {
|
102 | 102 | this.formatMappings.put("xls", JasperReportsXlsView.class);
|
103 | 103 | }
|
104 | 104 |
|
| 105 | + |
105 | 106 | /**
|
106 | 107 | * Set the key of the model parameter that holds the format discriminator.
|
107 | 108 | * Default is "format".
|
|
0 commit comments