org.topbraid.spin.system
Class SPINLabels

java.lang.Object
  extended by org.topbraid.spin.system.SPINLabels

public class SPINLabels
extends java.lang.Object

A singleton that is used to render resources into strings. By default this displays qnames (if possible). Can be changed, for example, to switch to displaying rdfs:labels instead of qnames etc.

Author:
Holger Knublauch

Constructor Summary
SPINLabels()
           
 
Method Summary
static SPINLabels get()
          Gets the singleton instance of this class.
 java.lang.String getCustomizedLabel(Resource resource)
          Gets a "human-readable" label for a given Resource.
 java.lang.String getLabel(Resource resource)
          Gets the label for a given Resource.
static void set(SPINLabels value)
          Replaces the singleton to a subclass with different behavior.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPINLabels

public SPINLabels()
Method Detail

get

public static SPINLabels get()
Gets the singleton instance of this class.

Returns:
the singleton

set

public static void set(SPINLabels value)
Replaces the singleton to a subclass with different behavior. This is used by TopBraid, which has its own rendering engine.

Parameters:
value - the new engine

getCustomizedLabel

public java.lang.String getCustomizedLabel(Resource resource)
Gets a "human-readable" label for a given Resource. This checks for any existing rdfs:label, otherwise falls back to getLabel().

Parameters:
resource -
Returns:

getLabel

public java.lang.String getLabel(Resource resource)
Gets the label for a given Resource.

Parameters:
resource - the Resource to get the label of
Returns:
the label (never null)