KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > jcr > impl > core > nodetype > exo > MockNodeType


1 /*
2  * Copyright 2001-2003 The eXo platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  */

5
6 package org.exoplatform.services.jcr.impl.core.nodetype.exo;
7
8
9 import javax.jcr.nodetype.PropertyDef;
10 import javax.jcr.nodetype.NodeDef;
11 import javax.jcr.PropertyType;
12 import javax.jcr.version.OnParentVersionAction;
13 import org.exoplatform.services.jcr.impl.core.nodetype.NodeDefImpl;
14 import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeImpl;
15 import org.exoplatform.services.jcr.impl.core.nodetype.PropertyDefImpl;
16 import org.exoplatform.services.jcr.impl.core.nodetype.nt.Base;
17
18 /**
19  * Created y the eXo platform team
20  * User: Benjamin Mestrallet
21  * Date: 5 ao�t 2004
22  */

23 public class MockNodeType extends NodeTypeImpl {
24   //name, declaringNodeType, requiredType,
25
// vlueConstraint, defaultValue, autoCreate, mandatory,
26
// onVersion, readOnly, primaryItem, multiple)
27

28   public MockNodeType() {
29     this.name = "exo:mockNodeType";
30     this.mixin = false;
31     this.declaredSupertypes = new javax.jcr.nodetype.NodeType[1];
32     this.declaredSupertypes[0] = new Base();
33     this.declaredPropertyDefs = new PropertyDef[2];
34     this.declaredPropertyDefs[0] = new PropertyDefImpl("jcr:nodeTypeName", null, PropertyType.STRING,
35         null, null, true, true,
36         OnParentVersionAction.COPY, false, false, false);
37     this.declaredPropertyDefs[1] = new PropertyDefImpl("jcr:supertypes", null, PropertyType.STRING,
38         null, null, true, false,
39         OnParentVersionAction.COPY, false, false, true);
40     this.declaredNodeDefs = new NodeDef[2];
41     String JavaDoc[] types = {"nt:propertyDef"};
42     this.declaredNodeDefs[0] = new NodeDefImpl("jcr:propertyDef", types, "nt:propertyDef",
43         null, null,
44         false, true, OnParentVersionAction.VERSION, false, false,
45         true);
46     types[0] = "nt:childNodeDef";
47     this.declaredNodeDefs[1] = new NodeDefImpl("jcr:childNodeDef", types, "nt:childNodeDef",
48         null, null,
49         false, true, OnParentVersionAction.VERSION, false, false,
50         true);
51   }
52 }
53
Popular Tags