KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > core > ItemType


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2005 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.core;
14
15 import java.io.Serializable JavaDoc;
16
17
18 /**
19  * @author Sameer Charles
20  * @version $Revision: 1111 $ ($Author: fgiust $)
21  */

22 public final class ItemType implements Serializable JavaDoc {
23
24     /**
25      * Node type: base.
26      */

27     public static final String JavaDoc NT_BASE = "nt:base"; //$NON-NLS-1$
28

29     /**
30      * Node type: unstructured.
31      */

32     public static final String JavaDoc NT_UNSTRUCTRUED = "nt:unstructured"; //$NON-NLS-1$
33

34     /**
35      * Node type: hierarchyNode.
36      */

37     public static final String JavaDoc NT_HIERARCHY = "nt:hierarchyNode"; //$NON-NLS-1$
38

39     /**
40      * Node type: folder.
41      */

42     public static final String JavaDoc NT_FOLDER = "nt:folder"; //$NON-NLS-1$
43

44     /**
45      * Node type: base.
46      */

47     public static final String JavaDoc NT_FILE = "nt:file"; //$NON-NLS-1$
48

49     /**
50      * Mixin: node has access control.
51      */

52     public static final String JavaDoc MIX_ACCESSCONTROLLABLE = "mix:accessControllable"; //$NON-NLS-1$
53

54     /**
55      * Mixin: node can be referenced.
56      */

57     public static final String JavaDoc MIX_REFERENCEABLE = "mix:referenceable"; //$NON-NLS-1$
58

59     /**
60      * Mixin: node can be versioned.
61      */

62     public static final String JavaDoc MIX_VERSIONABLE = "mix:versionable"; //$NON-NLS-1$
63

64     /**
65      * Magnolia content.
66      * @deprecated use ItemType.CONTENT
67      */

68     public static final String JavaDoc NT_CONTENT = "mgnl:content"; //$NON-NLS-1$
69

70     /**
71      * Magnolia content node.
72      * @deprecated use ItemType.CONTENTNODE
73      */

74     public static final String JavaDoc NT_CONTENTNODE = "mgnl:contentNode"; //$NON-NLS-1$
75

76     /**
77      * @deprecated
78      */

79     public static final String JavaDoc NT_NODEDATA = "mgnl:nodeData"; //$NON-NLS-1$
80

81     /**
82      * "mgnl:content"
83      */

84     public static final ItemType CONTENT = new ItemType("mgnl:content"); //$NON-NLS-1$
85

86     /**
87      * "mgnl:contentNode"
88      */

89     public static final ItemType CONTENTNODE = new ItemType("mgnl:contentNode"); //$NON-NLS-1$
90

91     /**
92      * "jcr:content"
93      */

94     public static final ItemType JCR_CONTENT = new ItemType("jcr:content"); //$NON-NLS-1$
95

96     /**
97      * Stable serialVersionUID.
98      */

99     private static final long serialVersionUID = 222L;
100
101     /**
102      * Node name.
103      */

104     private String JavaDoc systemName;
105
106     /**
107      * Can't be instantiated.
108      * @param systemName jcr system name
109      */

110     private ItemType(String JavaDoc systemName) {
111         this.systemName = systemName;
112     }
113
114     /**
115      * Getter for <code>name</code>.
116      * @return Returns the name.
117      */

118     public String JavaDoc getSystemName() {
119         return this.systemName;
120     }
121
122     /**
123      * @see java.lang.Object#equals(Object)
124      */

125     public boolean equals(Object JavaDoc object) {
126         if (!(object instanceof ItemType)) {
127             return false;
128         }
129         ItemType rhs = (ItemType) object;
130         return this.systemName.equals(rhs.systemName);
131     }
132
133     /**
134      * @see java.lang.Object#toString()
135      */

136     public String JavaDoc toString() {
137         return this.systemName;
138     }
139
140     /**
141      * @see java.lang.Object#hashCode()
142      */

143     public int hashCode() {
144         return this.systemName.hashCode();
145     }
146
147 }
148
Popular Tags