com.hp.hpl.swade.portal
Class NodeWrapper

java.lang.Object
  |
  +--com.hp.hpl.swade.portal.NodeWrapper
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
ResourceWrapper

public class NodeWrapper
extends java.lang.Object
implements java.lang.Comparable

Wrapper for RDFNodes to simplify template rendering.

Version:
$Revision: 1.1.1.1 $ on $Date: 2004/06/15 07:27:04 $
Author:
Dave Reynolds

Field Summary
protected  DataSource datasource
          The datasource this node is located in
protected  java.lang.String name
          Display name for this node
protected  com.hp.hpl.jena.rdf.model.RDFNode node
          The underlying RDFNode
 
Constructor Summary
NodeWrapper(com.hp.hpl.jena.rdf.model.RDFNode node, DataSource datasource)
          Constructor.
 
Method Summary
 int compareTo(java.lang.Object o1)
          Comparison based on displayname only.
 DataSource getDataSource()
          Return the datasource which holds this node
 java.lang.String getEncoding()
          Return an encoding of the Node suitable for transmission over a URL parameter.
 java.lang.String getName()
          Return a displayable name for this node, uses the label if available.
 com.hp.hpl.jena.rdf.model.RDFNode getNode()
          Return the RDFNode which this wraps
 boolean isLiteral()
          Return true if the node is a literal.
 java.lang.String render(java.lang.String context, javax.servlet.http.HttpServletRequest request)
          Return the HMTL rendering of this Node as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected com.hp.hpl.jena.rdf.model.RDFNode node
The underlying RDFNode


name

protected java.lang.String name
Display name for this node


datasource

protected DataSource datasource
The datasource this node is located in

Constructor Detail

NodeWrapper

public NodeWrapper(com.hp.hpl.jena.rdf.model.RDFNode node,
                   DataSource datasource)
Constructor.

Method Detail

getName

public java.lang.String getName()
Return a displayable name for this node, uses the label if available.


getDataSource

public DataSource getDataSource()
Return the datasource which holds this node


compareTo

public int compareTo(java.lang.Object o1)
Comparison based on displayname only.

Specified by:
compareTo in interface java.lang.Comparable

isLiteral

public boolean isLiteral()
Return true if the node is a literal.


render

public java.lang.String render(java.lang.String context,
                               javax.servlet.http.HttpServletRequest request)
Return the HMTL rendering of this Node as a string.


getEncoding

public java.lang.String getEncoding()
Return an encoding of the Node suitable for transmission over a URL parameter.


getNode

public com.hp.hpl.jena.rdf.model.RDFNode getNode()
Return the RDFNode which this wraps



Copyright © 2004 Hewlett-Packard. All Rights Reserved.