KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > dictionary > M2ModelDefinition


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.dictionary;
18
19 import java.util.Date JavaDoc;
20
21 import org.alfresco.service.cmr.dictionary.ModelDefinition;
22 import org.alfresco.service.namespace.NamespacePrefixResolver;
23 import org.alfresco.service.namespace.QName;
24
25 /**
26  * Compiled Model Definition
27  *
28  * @author David Caruana
29  *
30  */

31 public class M2ModelDefinition implements ModelDefinition
32 {
33     private QName name;
34     private M2Model model;
35     
36     
37     /*package*/ M2ModelDefinition(M2Model model, NamespacePrefixResolver resolver)
38     {
39         this.name = QName.createQName(model.getName(), resolver);
40         this.model = model;
41     }
42
43     
44     /* (non-Javadoc)
45      * @see org.alfresco.repo.dictionary.ModelDefinition#getName()
46      */

47     public QName getName()
48     {
49         return name;
50     }
51
52
53     /* (non-Javadoc)
54      * @see org.alfresco.repo.dictionary.ModelDefinition#getDescription()
55      */

56     public String JavaDoc getDescription()
57     {
58         String JavaDoc value = M2Label.getLabel(this, null, null, "description");
59         if (value == null)
60         {
61             value = model.getDescription();
62         }
63         return value;
64     }
65
66
67     /* (non-Javadoc)
68      * @see org.alfresco.repo.dictionary.ModelDefinition#getAuthor()
69      */

70     public String JavaDoc getAuthor()
71     {
72         return model.getAuthor();
73     }
74
75
76     /* (non-Javadoc)
77      * @see org.alfresco.repo.dictionary.ModelDefinition#getPublishedDate()
78      */

79     public Date JavaDoc getPublishedDate()
80     {
81         return model.getPublishedDate();
82     }
83
84
85     /* (non-Javadoc)
86      * @see org.alfresco.repo.dictionary.ModelDefinition#getVersion()
87      */

88     public String JavaDoc getVersion()
89     {
90         return model.getVersion();
91     }
92     
93 }
94
Popular Tags