org.eclipse.jst.jsp.core.taglib
Class TaglibIndex

java.lang.Object
  extended byorg.eclipse.jst.jsp.core.taglib.TaglibIndex

public final class TaglibIndex
extends java.lang.Object

A non-extendable index manager for taglibs similar to the previous J2EE ITaglibRegistry but lacking any ties to project natures. Each record returned from the index represents a single tag library descriptor. Indexing is only persisted between sessions for entries on the Java Build Path. New ADD events will be sent to ITaglibIndexListeners during each workbench session for both cached and newly found records. REMOVE events are not fired on workbench shutdown. The record's contents should be examined for any further information.

Since:
1.0

Method Summary
static void addTaglibIndexListener(ITaglibIndexListener listener)
          NOT API.
static ITaglibRecord[] getAvailableTaglibRecords(IPath fullPath)
          Finds all of the visible ITaglibRecords for the given path in the workspace.
static IPath getContextRoot(IPath path)
          Deprecated. - is not correct in flexible projects
static TaglibIndex getInstance()
           
static void removeTaglibIndexListener(ITaglibIndexListener listener)
          NOT API.
static ITaglibRecord resolve(java.lang.String basePath, java.lang.String reference, boolean crossProjects)
          Finds a matching ITaglibRecord given the reference.
static void shutdown()
          Instructs the index to stop listening for resource and classpath changes, and to forget all information about the workspace.
static void startup()
          Instructs the index to begin listening for resource and classpath changes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addTaglibIndexListener

public static void addTaglibIndexListener(ITaglibIndexListener listener)
NOT API.

Parameters:
listener - the listener to be added

getAvailableTaglibRecords

public static ITaglibRecord[] getAvailableTaglibRecords(IPath fullPath)
Finds all of the visible ITaglibRecords for the given path in the workspace. Taglib mappings from web.xml files are only visible to paths within the web.xml's corresponding web content folder.

Values defined within the XML Catalog will not be returned.

Parameters:
fullPath - - a path within the workspace
Returns:
All of the visible ITaglibRecords from the given path.

getContextRoot

public static IPath getContextRoot(IPath path)
Deprecated. - is not correct in flexible projects

Returns the IPath considered to be the web-app root for the given path. All resolution from the given path beginning with '/' will be relative to the computed web-app root.

Parameters:
path - - a path under the web-app root
Returns:
the IPath considered to be the web-app's root for the given path or null if one could not be determined

getInstance

public static TaglibIndex getInstance()

removeTaglibIndexListener

public static void removeTaglibIndexListener(ITaglibIndexListener listener)
NOT API.

Parameters:
listener - the listener to be removed

resolve

public static ITaglibRecord resolve(java.lang.String basePath,
                                    java.lang.String reference,
                                    boolean crossProjects)
Finds a matching ITaglibRecord given the reference. Typically the result will have to be cast to a subiinterface of ITaglibRecord.

Parameters:
basePath - - the workspace-relative path for IResources, full filesystem path otherwise
reference - - the URI to lookup, for example the uri value from a taglib directive
crossProjects - - whether to search across projects (currently ignored)
Returns:
a visible ITaglibRecord or null if the reference points to no known tag library descriptor

shutdown

public static void shutdown()
Instructs the index to stop listening for resource and classpath changes, and to forget all information about the workspace.


startup

public static void startup()
Instructs the index to begin listening for resource and classpath changes.