1 29 30 package com.caucho.jcr.base; 31 32 import javax.jcr.nodetype.ItemDefinition; 33 import javax.jcr.nodetype.NodeType; 34 import javax.jcr.version.OnParentVersionAction; 35 36 39 public class BaseItemDefinition implements ItemDefinition { 40 private final NodeType _nodeType; 41 private final String _name; 42 43 private boolean _isAutoCreated; 44 private boolean _isMandatory; 45 private int _onParentVersion = OnParentVersionAction.COPY; 46 private boolean _isProtected; 47 48 public BaseItemDefinition(String name, NodeType nodeType) 49 { 50 _name = name; 51 _nodeType = nodeType; 52 } 53 54 57 public NodeType getDeclaringNodeType() 58 { 59 return _nodeType; 60 } 61 62 65 public String getName() 66 { 67 return _name; 68 } 69 70 74 public boolean isAutoCreated() 75 { 76 return _isAutoCreated; 77 } 78 79 82 public void setAutoCreated(boolean isAutoCreated) 83 { 84 _isAutoCreated = isAutoCreated; 85 } 86 87 90 public boolean isMandatory() 91 { 92 return _isMandatory; 93 } 94 95 98 public void setMandatory(boolean isMandatory) 99 { 100 _isMandatory = isMandatory; 101 } 102 103 106 public int getOnParentVersion() 107 { 108 return _onParentVersion; 109 } 110 111 114 public void setOnParentVersion(int onParentVersion) 115 { 116 _onParentVersion = onParentVersion; 117 } 118 119 122 public boolean isProtected() 123 { 124 return _isProtected; 125 } 126 127 130 public void setProtected(boolean isProtected) 131 { 132 _isProtected = isProtected; 133 } 134 } 135 | Popular Tags |