public interface

ElementVisitor

com.google.gdata.model.ElementVisitor
Known Indirect Subclasses

Class Overview

The ElementVisitor interface describes the implementation of a visitor pattern for GData data model processing.

Summary

Nested Classes
class ElementVisitor.StoppedException The StoppedException is thrown by ElementVisitor instances to immediately exit from element tree processing. 
Public Methods
abstract boolean visit(Element parent, Element target, ElementMetadata<?, ?> metadata)
Called during Element tree traversal to allow the visitor instance to process an element in the tree.
abstract void visitComplete(Element parent, Element target, ElementMetadata<?, ?> metadata)
The visitComplete method is called when traversal for an Element and all of its nested children has been completed.

Public Methods

public abstract boolean visit (Element parent, Element target, ElementMetadata<?, ?> metadata)

Called during Element tree traversal to allow the visitor instance to process an element in the tree.

Parameters
parent The parent of the target element
target The target element being visited
metadata The metadata for the target element
Returns
  • boolean value indicating whether child elements (if any) should be visited.
Throws
ElementVisitor.StoppedException if the data model traversal should be stopped immediately. This may be the result of an unexpected error, or some visitor implementations may extend this exception type to signal specific exit conditions.

public abstract void visitComplete (Element parent, Element target, ElementMetadata<?, ?> metadata)

The visitComplete method is called when traversal for an Element and all of its nested children has been completed.

Parameters
parent The parent of the target element
target The visited element
metadata The metadata for the target element
Throws
ElementVisitor.StoppedException if the data model traversal should be stopped immediately. This may be the result of an unexpected error, or some visitor implementations may extend this exception type to signal specific exit conditions.