1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.cms.util;
35
36 import java.io.InputStream;
37 import java.util.Calendar;
38 import java.util.Collection;
39
40 import javax.jcr.ItemNotFoundException;
41 import javax.jcr.PathNotFoundException;
42 import javax.jcr.Property;
43 import javax.jcr.RepositoryException;
44 import javax.jcr.Value;
45
46 import info.magnolia.cms.core.Content;
47 import info.magnolia.cms.core.HierarchyManager;
48 import info.magnolia.cms.core.NodeData;
49 import info.magnolia.cms.security.AccessDeniedException;
50
51
52
53
54
55
56 public abstract class NodeDataWrapper implements NodeData {
57
58 private NodeData wrappedNodeData;
59
60 public NodeDataWrapper() {
61 }
62
63 public NodeDataWrapper(NodeData wrappedNodeData) {
64 this.wrappedNodeData = wrappedNodeData;
65 }
66
67 public NodeData getWrappedNodeData() {
68 return this.wrappedNodeData;
69 }
70
71 public void setWrappedNodeData(NodeData wrappedNodeData) {
72 this.wrappedNodeData = wrappedNodeData;
73 }
74
75 public String toString() {
76 final StringBuilder buffer = new StringBuilder();
77 buffer.append(getClass().getSimpleName());
78 buffer.append(" for ");
79 buffer.append(getWrappedNodeData().toString());
80 return buffer.toString();
81 }
82
83
84 public void delete() throws RepositoryException {
85 getWrappedNodeData().delete();
86 }
87
88 public String getAttribute(String name) {
89 return getWrappedNodeData().getAttribute(name);
90 }
91
92 public Collection getAttributeNames() throws RepositoryException {
93 return getWrappedNodeData().getAttributeNames();
94 }
95
96 public boolean getBoolean() {
97 return getWrappedNodeData().getBoolean();
98 }
99
100 public long getContentLength() {
101 return getWrappedNodeData().getContentLength();
102 }
103
104 public Calendar getDate() {
105 return getWrappedNodeData().getDate();
106 }
107
108 public double getDouble() {
109 return getWrappedNodeData().getDouble();
110 }
111
112 public String getHandle() {
113 return getWrappedNodeData().getHandle();
114 }
115
116 public HierarchyManager getHierarchyManager() {
117 return getWrappedNodeData().getHierarchyManager();
118 }
119
120 public Property getJCRProperty() {
121 return getWrappedNodeData().getJCRProperty();
122 }
123
124 public long getLong() {
125 return getWrappedNodeData().getLong();
126 }
127
128 public String getName() {
129 return getWrappedNodeData().getName();
130 }
131
132 public Content getParent() throws AccessDeniedException, ItemNotFoundException, javax.jcr.AccessDeniedException, RepositoryException {
133 return getWrappedNodeData().getParent();
134 }
135
136 public Content getReferencedContent() throws RepositoryException, PathNotFoundException, RepositoryException {
137 return getWrappedNodeData().getReferencedContent();
138 }
139
140 public Content getReferencedContent(String repositoryId) throws PathNotFoundException, RepositoryException {
141 return getWrappedNodeData().getReferencedContent(repositoryId);
142 }
143
144 public InputStream getStream() {
145 return getWrappedNodeData().getStream();
146 }
147
148 public String getString() {
149 return getWrappedNodeData().getString();
150 }
151
152 public String getString(String lineBreak) {
153 return getWrappedNodeData().getString(lineBreak);
154 }
155
156 public int getType() {
157 return getWrappedNodeData().getType();
158 }
159
160 public Value getValue() {
161 return getWrappedNodeData().getValue();
162 }
163
164 public Value[] getValues() {
165 return getWrappedNodeData().getValues();
166 }
167
168 public boolean isExist() {
169 return getWrappedNodeData().isExist();
170 }
171
172 public boolean isGranted(long permissions) {
173 return getWrappedNodeData().isGranted(permissions);
174 }
175
176 public int isMultiValue() {
177 return getWrappedNodeData().isMultiValue();
178 }
179
180 public void refresh(boolean keepChanges) throws RepositoryException {
181 getWrappedNodeData().refresh(keepChanges);
182 }
183
184 public void save() throws RepositoryException {
185 getWrappedNodeData().save();
186 }
187
188 public void setAttribute(String name, Calendar value) throws RepositoryException, AccessDeniedException, UnsupportedOperationException {
189 getWrappedNodeData().setAttribute(name, value);
190 }
191
192 public void setAttribute(String name, String value) throws RepositoryException, AccessDeniedException, UnsupportedOperationException {
193 getWrappedNodeData().setAttribute(name, value);
194 }
195
196 public void setValue(boolean value) throws RepositoryException, AccessDeniedException {
197 getWrappedNodeData().setValue(value);
198 }
199
200 public void setValue(Calendar value) throws RepositoryException, AccessDeniedException {
201 getWrappedNodeData().setValue(value);
202 }
203
204 public void setValue(double value) throws RepositoryException, AccessDeniedException {
205 getWrappedNodeData().setValue(value);
206 }
207
208 public void setValue(InputStream value) throws RepositoryException, AccessDeniedException {
209 getWrappedNodeData().setValue(value);
210 }
211
212 public void setValue(int value) throws RepositoryException, AccessDeniedException {
213 getWrappedNodeData().setValue(value);
214 }
215
216 public void setValue(long value) throws RepositoryException, AccessDeniedException {
217 getWrappedNodeData().setValue(value);
218 }
219
220 public void setValue(String value) throws RepositoryException, AccessDeniedException {
221 getWrappedNodeData().setValue(value);
222 }
223
224 public void setValue(Content value) throws RepositoryException, AccessDeniedException {
225 getWrappedNodeData().setValue(value);
226 }
227
228 public void setValue(Value value) throws RepositoryException, AccessDeniedException {
229 getWrappedNodeData().setValue(value);
230 }
231
232 public void setValue(Value[] value) throws RepositoryException, AccessDeniedException {
233 getWrappedNodeData().setValue(value);
234 }
235
236 }