org.ceryle.xml
Class IndexManager

java.lang.Object
  extended by org.ceryle.xml.IndexManager

public class IndexManager
extends Object

Uses an XMLProcessor to provide indexing features on XHTML documents. Note that this processor will optionally alter the document by fixing any mismatch between the id and name attributes (when ALink.fix is true and both attributes are specified). It will also fill in a missing id attribute if the name attribute is specified.

Since:
JDK1.4
Version:
$Id: IndexManager.java,v 3.7 2007-06-15 12:10:28 altheim Exp $
Author:
Murray Altheim
See Also:
XMLProcessor

Field Summary
protected  Vector m_alinks
           
protected  String m_doctitle
           
 
Constructor Summary
IndexManager(XMLProcessor xmlproc)
          Constructor provided an XMLProcessor xmlproc to be used for processing XML and XHTML Documents.
 
Method Summary
 Iterator getBodyText()
          Returns an Iterator over the Text objects in the current DOM document's <body> Element.
 Iterator getLinks(String classAttr)
          Returns an Iterator over the ALinks (those containing 'href' attributes) of the provided Document, from an already processed Document.
 Iterator getTargets(String classAttr)
          Returns an Iterator over the ALink targets of the provided Document, from an already processed Document.
 void index(Document doc)
          Processes the provided Document, building an index.
 void index(XNode xnode)
          Processes the provided XNode's content, building an index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_alinks

protected Vector m_alinks

m_doctitle

protected String m_doctitle
Constructor Detail

IndexManager

public IndexManager(XMLProcessor xmlproc)
Constructor provided an XMLProcessor xmlproc to be used for processing XML and XHTML Documents.

Method Detail

index

public void index(XNode xnode)
Processes the provided XNode's content, building an index.


getLinks

public Iterator getLinks(String classAttr)
Returns an Iterator over the ALinks (those containing 'href' attributes) of the provided Document, from an already processed Document. If the class parameter is non-null, it acts as a filter on the provided elements; they must then have a matching class attribute. Returns an empty Iterator rather than null unless there has been no processed Document.


getTargets

public Iterator getTargets(String classAttr)
Returns an Iterator over the ALink targets of the provided Document, from an already processed Document. If the class parameter is non-null, it acts as a filter on the provided elements; they must then have a matching class attribute. Returns an empty Iterator rather than null unless there has been no processed Document.


getBodyText

public Iterator getBodyText()
Returns an Iterator over the Text objects in the current DOM document's <body> Element. If the provided Document has no Text nodes, or the method is provided with a null parameter, an empty Iterator rather than null is returned.


index

public void index(Document doc)
Processes the provided Document, building an index.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.