Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
DisplayMacroParameters | 32 | 6 | 0% | 6 | 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.rendering.macro.display; | |
21 | ||
22 | import org.xwiki.model.EntityType; | |
23 | import org.xwiki.properties.annotation.PropertyDescription; | |
24 | import org.xwiki.properties.annotation.PropertyMandatory; | |
25 | ||
26 | /** | |
27 | * Parameters for the {@link org.xwiki.rendering.internal.macro.display.DisplayMacro} Macro. | |
28 | * | |
29 | * @version $Id: 1e61454f479b7c9bfa447783697bd2c718ab9f64 $ | |
30 | * @since 3.4M1 | |
31 | */ | |
32 | public class DisplayMacroParameters | |
33 | { | |
34 | /** | |
35 | * @see #getReference() | |
36 | */ | |
37 | private String reference; | |
38 | ||
39 | /** | |
40 | * @see #getType() | |
41 | */ | |
42 | private EntityType type = EntityType.DOCUMENT; | |
43 | ||
44 | /** | |
45 | * @see #getSection() | |
46 | */ | |
47 | private String section; | |
48 | ||
49 | /** | |
50 | * @param reference the reference to display | |
51 | * @since 3.4M1 | |
52 | */ | |
53 | 5 | @PropertyMandatory |
54 | @PropertyDescription("the reference of the resource to display") | |
55 | public void setReference(String reference) | |
56 | { | |
57 | 5 | this.reference = reference; |
58 | } | |
59 | ||
60 | /** | |
61 | * @return the reference of the resource to display | |
62 | * @since 3.4M1 | |
63 | */ | |
64 | 20 | public String getReference() |
65 | { | |
66 | 20 | return this.reference; |
67 | } | |
68 | ||
69 | /** | |
70 | * @return the type of the reference | |
71 | * @since 3.4M1 | |
72 | */ | |
73 | 7 | @PropertyDescription("the type of the reference") |
74 | public EntityType getType() | |
75 | { | |
76 | 7 | return this.type; |
77 | } | |
78 | ||
79 | /** | |
80 | * @param type the type of the reference | |
81 | * @since 3.4M1 | |
82 | */ | |
83 | 0 | public void setType(EntityType type) |
84 | { | |
85 | 0 | this.type = type; |
86 | } | |
87 | ||
88 | /** | |
89 | * @param sectionId see {@link #getSection()} | |
90 | */ | |
91 | 0 | @PropertyDescription("an optional id of a section to include in the specified document") |
92 | public void setSection(String sectionId) | |
93 | { | |
94 | 0 | this.section = sectionId; |
95 | } | |
96 | ||
97 | /** | |
98 | * @return the optional id of a section to include in the referenced document. If not specified the whole document | |
99 | * is included. | |
100 | */ | |
101 | 12 | public String getSection() |
102 | { | |
103 | 12 | return this.section; |
104 | } | |
105 | } |