1 package org.sapia.archie.strategy; 2 3 import org.sapia.archie.Name; 4 import org.sapia.archie.NamePart; 5 import org.sapia.archie.Node; 6 import org.sapia.archie.NotFoundException; 7 import org.sapia.archie.ProcessingException; 8 9 10 22 public class DefaultLookupStrategy extends DefaultLookupNodeStrategy { 23 public DefaultLookupStrategy() { 24 super(false); 25 } 26 27 30 public Object lookup(Name n, Node from) 31 throws NotFoundException, ProcessingException { 32 NamePart last = n.chopLast(); 33 Node node = (Node) super.lookup(n, from); 34 35 Object value = node.getValue(last); 36 37 if (value == null) { 38 throw new NotFoundException(n.toString()); 39 } 40 41 return value; 42 } 43 } 44 | Popular Tags |