de.fuberlin.wiwiss.d2rq.map
Class TranslationTable

java.lang.Object
  extended by de.fuberlin.wiwiss.d2rq.map.MapObject
      extended by de.fuberlin.wiwiss.d2rq.map.TranslationTable

public class TranslationTable
extends MapObject

Represents a d2rq:TranslationTable.

Author:
Richard Cyganiak (richard@cyganiak.de), zazi (http://github.com/zazi)

Nested Class Summary
static class TranslationTable.Translation
           
 
Constructor Summary
TranslationTable(Resource resource)
           
 
Method Summary
 void addTranslation(String dbValue, String rdfValue)
          Adds a translation mapping.
 void setHref(String href)
           
 void setJavaClass(String className)
          Sets a translation class.
 int size()
          Returns the number of defined mappings.
 String toString()
           
 Translator translator()
           
 void validate()
           
 
Methods inherited from class de.fuberlin.wiwiss.d2rq.map.MapObject
assertArgumentNotNull, assertHasBeenDefined, assertNotYetDefined, resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TranslationTable

public TranslationTable(Resource resource)
Method Detail

size

public int size()
Returns the number of defined mappings.


addTranslation

public void addTranslation(String dbValue,
                           String rdfValue)
Adds a translation mapping.

Parameters:
dbValue - the value on the database side (usually coming from a DB column)
rdfValue - the value on the RDF side (a string or URI)

setJavaClass

public void setJavaClass(String className)
Sets a translation class. The translation class must implement the Translator interface. This method will take care of generating an instance of the class.

Parameters:
className - name of a class implementing Translator

setHref

public void setHref(String href)

translator

public Translator translator()

validate

public void validate()
              throws D2RQException
Specified by:
validate in class MapObject
Throws:
D2RQException

toString

public String toString()
Overrides:
toString in class MapObject