Previous Topic

Next Topic

Built-in Visitor Pattern

JRDF nodes are implemented with a visitor pattern to provide an object oriented approach to node-type specific behaviour. Nodes implement the TypedNodeVisitable interface and classes that use the pattern implement the TypedNodeVisitor interface.

In This Section

TypedNodeVisitable

TypedNodeVisitor

See Also

Java RDF (JRDF)

JRDF APIs

JRDF Graphs

Querying a JRDF Graph

TKS Client Support

JRDF Memory Implementation

Containers and Collections

Examples

TypedNodeVisitable

Nodes implement the accept(TypedNodeVisitor visitor) method to call visitor.visitXXX(this), where XXX represents the node type. For example, visitBlankNode(this) is called by a BlankNode.

TypedNodeVisitor

TypedNodeVisitors implement three methods:

  1. visitBlankNode(BlankNode blankNode)
  2. visitLiteral(Literal literal)
  3. visitURIReference(URIReference uriReference)

When a TypedNodeVisitor calls accept(this) on a TypedNodeVisitable(Node), the TypedNodeVisitable calls the appropriate visitXXX() method, where XXX represents the Node type. The method names contain the node type to provide clarity for classes implementing the TypeNodeVisitor interface.

Latest News

Kowari 1.1.0 Pre-release 1 Released

Kowari 1.0.5 Released

Kowari 1.0.4.1 Released

Kowari 1.0.4 Released

DAWG Evaluates iTQL

Kowari article in XML.com

Kowari mentioned on XML.com

Kowari 1.0.3 Released

Kowari Lite Introduced

Kowari 1.0.2 Released

Kowari 1.0.1 Released

View all news items


Open Source logo Tucana Technologies Logo SourceForge.net Logo

© 2001-2004 Tucana Technologies, Inc. Some rights reserved.