File Source: Categories.java
/*
P/P * Method: org.apache.roller.weblogger.webservices.atomprotocol.Categories__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 package org.apache.roller.weblogger.webservices.atomprotocol;
19
20 import com.sun.syndication.feed.atom.Category;
21 import java.util.ArrayList;
22 import java.util.List;
23
24
25 /**
26 * Categories object may contain Category objects
27 *//*
28 appInlineCategories =
29 element app:categories {
30 attribute fixed { "yes" | "no" }?,
31 attribute scheme { atomURI }?,
32 (atomCategory*)
33 }
34 */
/*
P/P * Method: void org.apache.roller.weblogger.webservices.atomprotocol.Categories()
*
* Postconditions:
* this.categories == &new ArrayList(Categories#1)
* this.fixed == 0
* this.scheme == null
* new ArrayList(Categories#1) num objects == 1
*/
35 public class Categories {
36 private List categories = new ArrayList(); // of Category objects
37 private String scheme = null;
38 private boolean fixed = false;
39
40 /** Add category list of those specified*/
41 public void addCategory(Category cat) {
/*
P/P * Method: void addCategory(Category)
*
* Preconditions:
* this.categories != null
*/
42 categories.add(cat);
43 }
44
45 /** Iterate over Category objects */
46 public List getCategories() {
/*
P/P * Method: List getCategories()
*
* Preconditions:
* init'ed(this.categories)
*
* Postconditions:
* return_value == this.categories
* init'ed(return_value)
*/
47 return categories;
48 }
49
50 /** True if clients MUST use one of the categories specified */
51 public boolean isFixed() {
/*
P/P * Method: bool isFixed()
*
* Preconditions:
* init'ed(this.fixed)
*
* Postconditions:
* return_value == this.fixed
* init'ed(return_value)
*/
52 return fixed;
53 }
54
55 /** True if clients MUST use one of the categories specified */
56 public void setFixed(boolean fixed) {
/*
P/P * Method: void setFixed(bool)
*
* Postconditions:
* this.fixed == fixed
* init'ed(this.fixed)
*/
57 this.fixed = fixed;
58 }
59
60 /** Category URI scheme to use for Categories without a scheme */
61 public String getScheme() {
/*
P/P * Method: String getScheme()
*
* Preconditions:
* init'ed(this.scheme)
*
* Postconditions:
* return_value == this.scheme
* init'ed(return_value)
*/
62 return scheme;
63 }
64
65 /** Category URI scheme to use for Categories without a scheme */
66 public void setScheme(String scheme) {
/*
P/P * Method: void setScheme(String)
*
* Postconditions:
* this.scheme == scheme
* init'ed(this.scheme)
*/
67 this.scheme = scheme;
68 }
69
70 }
SofCheck Inspector Build Version : 2.18479
| Categories.java |
2009-Jan-02 14:25:30 |
| Categories.class |
2009-Sep-04 03:12:46 |