View Javadoc

1   /*
2    * Copyright 2012-2013 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not 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.
15   */
16  package de.smartics.properties.api.core.domain;
17  
18  
19  /**
20   * Provides property set information read from an SDoc XML document.
21   */
22  public final class PropertySetProjectdoc extends ProjectdocMetaData
23  {
24  
25    /**
26     * The class version identifier.
27     * <p>
28     * The value of this constant is {@value}.
29     * </p>
30     */
31    private static final long serialVersionUID = 1L;
32  
33    // ********************************* Fields *********************************
34  
35    // --- constants ------------------------------------------------------------
36  
37    // --- members --------------------------------------------------------------
38  
39    /**
40     * The property set comment.
41     */
42    private String comment;
43  
44    // ****************************** Initializer *******************************
45  
46    // ****************************** Constructors ******************************
47  
48    /**
49     * Default constructor without parent.
50     */
51    public PropertySetProjectdoc()
52    {
53      super();
54    }
55  
56    /**
57     * Default constructor with parent.
58     *
59     * @param parent the reference to the parent meta data to access as default
60     *          values.
61     */
62    public PropertySetProjectdoc(final ProjectdocMetaData parent)
63    {
64      super(parent);
65    }
66  
67    // ****************************** Inner Classes *****************************
68  
69    // ********************************* Methods ********************************
70  
71    // --- init -----------------------------------------------------------------
72  
73    // --- get&set --------------------------------------------------------------
74  
75    /**
76     * Returns the property set comment.
77     *
78     * @return the property set comment.
79     */
80    public String getComment()
81    {
82      return comment;
83    }
84  
85    /**
86     * Sets the property set comment.
87     *
88     * @param comment the property set comment.
89     */
90    public void setComment(final String comment)
91    {
92      this.comment = comment;
93    }
94  
95    // --- business -------------------------------------------------------------
96  
97    /**
98     * Upgrades the meta data to an instance of this type.
99     *
100    * @param metaData the information to upgrade.
101    * @return the upgraded information, that is the given meta data copied to
102    *         this type.
103    */
104   public static PropertySetProjectdoc upgrade(final ProjectdocMetaData metaData)
105   {
106     if (metaData == null)
107     {
108       return null;
109     }
110 
111     final PropertySetProjectdoc projectdoc =
112         new PropertySetProjectdoc(metaData.getParent());
113 
114     projectdoc.setName(metaData.getName());
115     projectdoc.setShortDescription(metaData.getShortDescription());
116     projectdoc.setSortKey(metaData.getSortKey());
117     projectdoc.setSpace(metaData.getSpace());
118     projectdoc.setSummary(metaData.getSummary());
119     projectdoc.setTitle(metaData.getTitle());
120 
121     for (final String item : metaData.getAudience())
122     {
123       projectdoc.addAudience(item);
124     }
125     for (final String item : metaData.getAudience())
126     {
127       projectdoc.addAudience(item);
128     }
129     for (final String item : metaData.getCategories())
130     {
131       projectdoc.addCategory(item);
132     }
133     for (final String item : metaData.getNotes())
134     {
135       projectdoc.addNote(item);
136     }
137     for (final String item : metaData.getParents())
138     {
139       projectdoc.addParent(item);
140     }
141     for (final String item : metaData.getTags())
142     {
143       projectdoc.addTag(item);
144     }
145 
146     return projectdoc;
147   }
148 
149   // --- object basics --------------------------------------------------------
150 
151 }