com.ibm.portal
Interface Locator<E>

All Known Subinterfaces:
AddablePortletsLocator<E>, AggregatedMetaDataLocator, ClientListLocator<T>, CommunicationEndpointLocator<E>, ControlLocator<E>, DeviceClassLocator<E>, DialogDefinitionLocator<E>, IWidgetWrapperLocator<T>, LocalizedLocator<E>, MappingURLLocator, MetaDataLocator<V,E>, MetaDataNameLocator, PortletDefinitionLocator<T>, PortletLocator<E>, PublicRenderParameterLocator<T>, RatingLocator<R>, RatingModelLocator<R,S>, ResourceLocator<T>, ResourceModelLocator<R>, SkinModelLocator<E>, TagLocator<T>, TagModelLocator<T,S>, TimeStampedResourceLocator<E>, TransitionEndpointLocator<E>, TransitionLocator<E>, UniqueNameLocator<E>, VanityURLModelLocator<E>, VirtualPortalLocator<E>, WireLocator

public interface Locator<E>

This interface defines search methods that allow locating resources in a model. A resource is identified by its Object ID (mandatory) or associated unique name (optional). This interface is the base for all locators; other locators allow a more specific search in the context they are offered in, e.g. a search for a node with certain properties in a model.

A Locator is usually obtained using a LocatorProvider:

 SearchableTreeModel model = ...;
 Locator locator = model.getLocator();
 Object node = locator.findByUniqueName("my.Unique.Name");
 
This locator returns an Object which is part of some model. What exact kind of object is returned depends on the locator. Please refer to individual JavaDoc for the locator used. The result object can be expected to be an element of the model the locator is used on unless specified otherwise.

Since:
5.1.0.1

Method Summary
 E findByID(ObjectID anObjectID)
          Returns an element of a model with the given ID.
 E findByUniqueName(java.lang.String aName)
          Returns an element of a model with the given name.
 

Method Detail

findByID

E findByID(ObjectID anObjectID)
Returns an element of a model with the given ID.

Parameters:
anObjectID - the id of the object to find. Must not be null.
Returns:
the element of the tree with the given object ID or null if the element cannot be found.
Throws:
java.lang.UnsupportedOperationException - if findByID is semantically not possible for the locator implementation

findByUniqueName

E findByUniqueName(java.lang.String aName)
Returns an element of a model with the given name.

Parameters:
aName - the name of the object to find. Must not be null.
Returns:
the element of the tree with the given name or null if the element cannot be found.
Throws:
java.lang.UnsupportedOperationException - if findByUniqueName is semantically not possible for the locator implementation