KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > content > CategoryKey


1 package org.jahia.content;
2
3 /**
4  * <p>Title: A ObjectKey class for categories</p>
5  * <p>Description: </p>
6  * <p>Copyright: Copyright (c) 2002</p>
7  * <p>Company: Jahia Ltd</p>
8  * @author Serge Huber
9  * @version 1.0
10  */

11
12 public class CategoryKey extends ObjectKey {
13
14     public static final String JavaDoc CATEGORY_TYPE = "Category";
15
16     static {
17         ObjectKey.registerType(CATEGORY_TYPE, CategoryKey.class.getName());
18     }
19
20     public CategoryKey(int categoryID) {
21         super(CATEGORY_TYPE, Integer.toString(categoryID));
22     }
23
24     public int getCategoryID() {
25         return getIdInType();
26     }
27
28     public static ObjectKey getChildInstance(String JavaDoc IDInType) {
29         return new CategoryKey(Integer.parseInt(IDInType));
30     }
31
32 }
Popular Tags