com.bbn.swede.core.dom
Class ModelCleanupVisitor

java.lang.Object
  extended bycom.bbn.swede.core.dom.ModelCleanupVisitor
All Implemented Interfaces:
IOASTNodeVisitor

public class ModelCleanupVisitor
extends Object
implements IOASTNodeVisitor

A visitor to tidy the Jena model prior to node removal. Resource and Statement instances associated with any node encountered by visit() are removed from the model.

Author:
jlerner

Field Summary
protected  Model _model
          The model to clean.
protected  Map _resources
          A map containing lists of nodes associated with Jena resources.
protected  Map _statements
          A map containing lists of nodes associated with Jena statements.
 
Constructor Summary
ModelCleanupVisitor(Model model, Map resourceToNode, Map statementToNode)
          Creates a new ModelCleanupVisitor to run against a specific model.
 
Method Summary
 boolean visit(OASTNode node)
          Performs the recursion's action for a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_model

protected Model _model
The model to clean.


_resources

protected Map _resources
A map containing lists of nodes associated with Jena resources.


_statements

protected Map _statements
A map containing lists of nodes associated with Jena statements.

Constructor Detail

ModelCleanupVisitor

public ModelCleanupVisitor(Model model,
                           Map resourceToNode,
                           Map statementToNode)
Creates a new ModelCleanupVisitor to run against a specific model.

Parameters:
model - The model to remove Resources and Statements from
statementToNode - Maps resources to lists of referencing nodes
resourceToNode - Maps statements to lists of referencing nodes
Method Detail

visit

public boolean visit(OASTNode node)
Description copied from interface: IOASTNodeVisitor
Performs the recursion's action for a node. The return value indicates whether to process the node's children.

Specified by:
visit in interface IOASTNodeVisitor
Parameters:
node - The node
Returns:
true to continue and visit node's children, false to prevent them from being processed.


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.