1 29 30 package com.caucho.jcr.base; 31 32 import javax.jcr.*; 33 import javax.jcr.lock.LockException; 34 import javax.jcr.nodetype.ConstraintViolationException; 35 import javax.jcr.nodetype.NoSuchNodeTypeException; 36 import javax.jcr.version.VersionException; 37 38 41 public class BaseItem implements Item { 42 protected BaseItem() 43 { 44 } 45 46 49 public String getPath() 50 throws RepositoryException 51 { 52 throw new UnsupportedOperationException (getClass().getName()); 53 } 54 55 58 public String getName() 59 throws RepositoryException 60 { 61 throw new UnsupportedOperationException (getClass().getName()); 62 } 63 64 67 public Item getAncestor(int depth) 68 throws ItemNotFoundException, 69 AccessDeniedException, 70 RepositoryException 71 { 72 Item item = this; 73 74 for (; depth > 0; depth--) { 75 item = item.getParent(); 76 } 77 78 return item; 79 } 80 81 84 public Node getParent() 85 throws ItemNotFoundException, 86 AccessDeniedException, 87 RepositoryException 88 { 89 throw new UnsupportedOperationException (getClass().getName()); 90 } 91 92 95 public int getDepth() 96 throws RepositoryException 97 { 98 throw new UnsupportedOperationException (getClass().getName()); 99 } 100 101 104 public Session getSession() 105 throws RepositoryException 106 { 107 throw new UnsupportedOperationException (getClass().getName()); 108 } 109 110 113 public boolean isNode() 114 { 115 return false; 116 } 117 118 121 public boolean isNew() 122 { 123 return false; 124 } 125 126 129 public boolean isModified() 130 { 131 return false; 132 } 133 134 137 public boolean isSame(Item otherItem) 138 throws RepositoryException 139 { 140 return this == otherItem; 141 } 142 143 146 public void accept(ItemVisitor visitor) 147 throws RepositoryException 148 { 149 throw new UnsupportedOperationException (getClass().getName()); 150 } 151 152 155 public void save() 156 throws AccessDeniedException, 157 ItemExistsException, 158 ConstraintViolationException, 159 InvalidItemStateException, 160 ReferentialIntegrityException, 161 VersionException, 162 LockException, 163 NoSuchNodeTypeException, 164 RepositoryException 165 { 166 throw new UnsupportedOperationException (getClass().getName()); 167 } 168 169 174 public void refresh(boolean keepChanges) 175 throws InvalidItemStateException, 176 RepositoryException 177 { 178 throw new UnsupportedOperationException (getClass().getName()); 179 } 180 181 184 public void remove() 185 throws VersionException, 186 LockException, 187 ConstraintViolationException, 188 RepositoryException 189 { 190 throw new UnsupportedOperationException (getClass().getName()); 191 } 192 } 193 | Popular Tags |