File Source: WeblogEntryAttributeWrapper.java
/*
P/P * Method: org.apache.roller.weblogger.pojos.wrapper.WeblogEntryAttributeWrapper__static_init
*/
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */
18
19 package org.apache.roller.weblogger.pojos.wrapper;
20
21 import org.apache.roller.weblogger.pojos.WeblogEntryAttribute;
22
23
24 /**
25 * Pojo safety wrapper for WeblogEntryAttribute object.
26 */
27 public class WeblogEntryAttributeWrapper {
28
29 // keep a reference to the wrapped pojo
30 private final WeblogEntryAttribute pojo;
31
32 // this is private so that we can force the use of the .wrap(pojo) method
/*
P/P * Method: void org.apache.roller.weblogger.pojos.wrapper.WeblogEntryAttributeWrapper(WeblogEntryAttribute)
*
* Postconditions:
* this.pojo == toWrap
* init'ed(this.pojo)
*/
33 private WeblogEntryAttributeWrapper(WeblogEntryAttribute toWrap) {
34 this.pojo = toWrap;
35 }
36
37
38 // wrap the given pojo if it is not null
39 public static WeblogEntryAttributeWrapper wrap(WeblogEntryAttribute toWrap) {
/*
P/P * Method: WeblogEntryAttributeWrapper wrap(WeblogEntryAttribute)
*
* Postconditions:
* return_value == One-of{&new WeblogEntryAttributeWrapper(wrap#1), null}
* return_value in Addr_Set{null,&new WeblogEntryAttributeWrapper(wrap#1)}
* new WeblogEntryAttributeWrapper(wrap#1) num objects <= 1
* new WeblogEntryAttributeWrapper(wrap#1).pojo == toWrap
* new WeblogEntryAttributeWrapper(wrap#1).pojo != null
*
* Test Vectors:
* toWrap: Addr_Set{null}, Inverse{null}
*/
40 if(toWrap != null)
41 return new WeblogEntryAttributeWrapper(toWrap);
42
43 return null;
44 }
45
46 // NOTD: removing this for 4.0 because there is no need for it
47 // public String getId() {
48 // return this.pojo.getId();
49 // }
50
51 // NOTE: removing this for 4.0 because there is no need for it
52 // public WeblogEntryWrapper getEntry() {
53 // return WeblogEntryWrapper.wrap(this.pojo.getEntry());
54 // }
55
56
57 public String getName() {
/*
P/P * Method: String getName()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
58 return this.pojo.getName();
59 }
60
61
62 public String getValue() {
/*
P/P * Method: String getValue()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
63 return this.pojo.getValue();
64 }
65
66 }
SofCheck Inspector Build Version : 2.18479
| WeblogEntryAttributeWrapper.java |
2009-Jan-02 14:25:32 |
| WeblogEntryAttributeWrapper.class |
2009-Sep-04 03:12:32 |