KickJava   Java API By Example, From Geeks To Geeks.

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


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.Map JavaDoc;
20
21 import org.alfresco.service.cmr.dictionary.AssociationDefinition;
22 import org.alfresco.service.cmr.dictionary.ModelDefinition;
23 import org.alfresco.service.cmr.dictionary.PropertyDefinition;
24 import org.alfresco.service.cmr.dictionary.TypeDefinition;
25 import org.alfresco.service.namespace.NamespacePrefixResolver;
26 import org.alfresco.service.namespace.QName;
27
28
29 /**
30  * Compiled Type Definition
31  *
32  * @author David Caruana
33  */

34 /*package*/ class M2TypeDefinition extends M2ClassDefinition
35     implements TypeDefinition
36 {
37     /*package*/ M2TypeDefinition(ModelDefinition model, M2Type m2Type, NamespacePrefixResolver resolver, Map JavaDoc<QName, PropertyDefinition> modelProperties, Map JavaDoc<QName, AssociationDefinition> modelAssociations)
38     {
39         super(model, m2Type, resolver, modelProperties, modelAssociations);
40     }
41     
42     @Override JavaDoc
43     public String JavaDoc getDescription()
44     {
45         String JavaDoc value = M2Label.getLabel(model, "type", name, "description");
46         
47         // if we don't have a description call the super class
48
if (value == null)
49         {
50            value = super.getDescription();
51         }
52         
53         return value;
54     }
55
56     @Override JavaDoc
57     public String JavaDoc getTitle()
58     {
59         String JavaDoc value = M2Label.getLabel(model, "type", name, "title");
60         
61         // if we don't have a title call the super class
62
if (value == null)
63         {
64            value = super.getTitle();
65         }
66         
67         return value;
68    }
69 }
70
Popular Tags