Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
OfficeDocumentView | 36 | 6 | 0% | 4 | 4 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.office.viewer.internal; | |
21 | ||
22 | import java.io.File; | |
23 | import java.util.Set; | |
24 | ||
25 | import org.xwiki.rendering.block.XDOM; | |
26 | import org.xwiki.rendering.listener.reference.ResourceReference; | |
27 | ||
28 | /** | |
29 | * Holds all the information belonging to an office attachment view. Instances of this class are mainly used for caching | |
30 | * office attachment views. | |
31 | * | |
32 | * @since 5.4.6 | |
33 | * @since 6.2.2 | |
34 | * @version $Id: 6e48c686590b1a2d699f4a0f582ee8a83ba3aa83 $ | |
35 | */ | |
36 | public class OfficeDocumentView | |
37 | { | |
38 | /** | |
39 | * @see #getResourceReference() | |
40 | */ | |
41 | private final ResourceReference resourceReference; | |
42 | ||
43 | /** | |
44 | * @see #getXDOM() | |
45 | */ | |
46 | private final XDOM xdom; | |
47 | ||
48 | /** | |
49 | * @see #getTemporaryFiles() | |
50 | */ | |
51 | private final Set<File> temporaryFiles; | |
52 | ||
53 | /** | |
54 | * Creates a new {@link OfficeDocumentView} instance. | |
55 | * | |
56 | * @param reference the reference to the office file to which this view belongs | |
57 | * @param xdom {@link XDOM} representation of the office document | |
58 | * @param temporaryFiles temporary files used by this view | |
59 | */ | |
60 | 6 | public OfficeDocumentView(ResourceReference reference, XDOM xdom, Set<File> temporaryFiles) |
61 | { | |
62 | 6 | this.resourceReference = reference; |
63 | 6 | this.xdom = xdom; |
64 | 6 | this.temporaryFiles = temporaryFiles; |
65 | } | |
66 | ||
67 | /** | |
68 | * @return a reference to the office file that is the source of this view | |
69 | */ | |
70 | 0 | public ResourceReference getResourceReference() |
71 | { | |
72 | 0 | return this.resourceReference; |
73 | } | |
74 | ||
75 | /** | |
76 | * @return {@link XDOM} representation of the office document | |
77 | */ | |
78 | 5 | public XDOM getXDOM() |
79 | { | |
80 | 5 | return this.xdom; |
81 | } | |
82 | ||
83 | /** | |
84 | * @return the temporary files used by this view. | |
85 | */ | |
86 | 0 | public Set<File> getTemporaryFiles() |
87 | { | |
88 | 0 | return this.temporaryFiles; |
89 | } | |
90 | } |