1 package org.sapia.archie.strategy; 2 3 import org.sapia.archie.Name; 4 import org.sapia.archie.Node; 5 import org.sapia.archie.NotFoundException; 6 import org.sapia.archie.ProcessingException; 7 8 9 /** 10 * This interface specifies lookup strategy behavior. It decouples lookup 11 * logic from node implementations. Different strategies can be implemented, 12 * according to applications needs, without having to mingle with node 13 * implementations. 14 * 15 * @author Yanick Duchesne 16 * 17 * <dl> 18 * <dt><b>Copyright:</b><dd>Copyright © 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt> 19 * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the 20 * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt> 21 * </dl> 22 */ 23 public interface LookupStrategy { 24 25 /** 26 * Performs the lookup operation from the given node. 27 * 28 * @param n the <code>Name</code> of the value to lookup. 29 * @param from the <code>Node</code> from which the search starts. 30 * @return the <code>Object</code> that corresponds to the given name. 31 * 32 * @throws NotFoundException if no object is found for the given name. 33 * @throws ProcessingException if a problem occurs while performing the lookup. 34 */ 35 public Object lookup(Name n, Node from) 36 throws NotFoundException, ProcessingException; 37 } 38