atg.projects.store.assembler.cartridge
Class ContentItemTreeIterator

java.lang.Object
  extended by atg.projects.store.assembler.cartridge.ContentItemTreeIterator
Direct Known Subclasses:
CrossCartridgeItemsLookup

public abstract class ContentItemTreeIterator
extends java.lang.Object

An abstract base class which provides the functionality for traversing content item tree.

For each detected content item during tree traversing the process method is called. The actual implementation of the process method should be provided by the subclasses.

If a circular reference is detected during tree traversing the process is terminated with the exception.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/Endeca/Assembler/src/atg/projects/store/assembler/cartridge/ContentItemTreeIterator.java#2 $$Change: 788983 $
Author:
Natallia Paulouskaya

Field Summary
protected static java.lang.String CLASS_VERSION
          Class version string.
 
Constructor Summary
ContentItemTreeIterator()
           
 
Method Summary
protected  java.lang.String getCircularReferenceErrorMessage(com.endeca.infront.assembler.ContentItem pContentItem)
          Returns the error message for the circular reference.
abstract  void process(com.endeca.infront.assembler.ContentItem pContentItem)
          The method contains processing logic that need to be executed for each detected content item during content item tree traversing.
 void traverse(com.endeca.infront.assembler.ContentItem pContentItem)
          The entry point for traversing content item tree.
protected  void traverseChildren(com.endeca.infront.assembler.ContentItem pContentItem)
          Traverses the content item's children.
protected  void traverseList(java.util.List<?> pList)
          Traverses the list of objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

protected static final java.lang.String CLASS_VERSION
Class version string.

See Also:
Constant Field Values
Constructor Detail

ContentItemTreeIterator

public ContentItemTreeIterator()
Method Detail

traverse

public void traverse(com.endeca.infront.assembler.ContentItem pContentItem)
              throws com.endeca.infront.assembler.CartridgeHandlerException
The entry point for traversing content item tree. The method first processes the content item passed in and then moves to processing its children.

Parameters:
pContentItem - - The content item to process.
Throws:
com.endeca.infront.assembler.CartridgeHandlerException - if the content item has already been visited.

getCircularReferenceErrorMessage

protected java.lang.String getCircularReferenceErrorMessage(com.endeca.infront.assembler.ContentItem pContentItem)
Returns the error message for the circular reference. Builds the full path to the content item where the circular reference were detected.

Parameters:
pContentItem - The content item where the circular reference were detected.
Returns:
The error message for the circular reference.

traverseChildren

protected void traverseChildren(com.endeca.infront.assembler.ContentItem pContentItem)
                         throws com.endeca.infront.assembler.CartridgeHandlerException
Traverses the content item's children. When a child content item is detected the method calls the traverse method for it to traverse it further.

Parameters:
pContentItem - The content item which children to traverse.
Throws:
com.endeca.infront.assembler.CartridgeHandlerException - if the content item has already been visited.

traverseList

protected void traverseList(java.util.List<?> pList)
                     throws com.endeca.infront.assembler.CartridgeHandlerException
Traverses the list of objects. If list members are content items they are passed to traverse method for further processing.

Parameters:
pList - - The list of objects to traverse.
Throws:
com.endeca.infront.assembler.CartridgeHandlerException - if the content item has already been visited.

process

public abstract void process(com.endeca.infront.assembler.ContentItem pContentItem)
The method contains processing logic that need to be executed for each detected content item during content item tree traversing.

Parameters:
pContentItem - The content item to process.