Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hp.hpl.jena.datatypes
Class TypeMapper

    java.lang.Object
      com.hp.hpl.jena.datatypes.TypeMapper

    public class TypeMapper

extends java.lang.Object

The TypeMapper provides a global registry of known datatypes. The datatypes can be retrieved by their URI or from the java class that is used to represent them.

Version:
  $Revision: 1.10 $ on $Date: 2008/01/02 12:10:24 $
Author:
  Dave Reynolds

Constructor Summary
`TypeMapper()`

Method Summary
`static TypeMapper` | `getInstance()` Return the single global instance of the TypeMapper.
`RDFDatatype` | `getSafeTypeByName(java.lang.String uri)` Version of getTypeByName which will treat unknown URIs as typed literals but with just the default implementation
`RDFDatatype` | `getTypeByName(java.lang.String uri)` Lookup a known datatype.
`RDFDatatype` | `getTypeByValue(java.lang.Object value)` Method getTypeByValue.
`java.util.Iterator` | `listTypes()` List all the known datatypes
`static void` | `main(java.lang.String[] args)`
`void` | `registerDatatype(RDFDatatype type)` Register a new datatype

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TypeMapper

    public TypeMapper()

Method Detail

### getInstance

    public static TypeMapper getInstance()

  Return the single global instance of the TypeMapper. Done this way rather than simply making the static field directly accessible to allow us to dynamically replace the entire mapper table if needed.

### getSafeTypeByName

    public RDFDatatype getSafeTypeByName(java.lang.String uri)

  Version of getTypeByName which will treat unknown URIs as typed literals but with just the default implementation

  Parameters:
    `uri` - the URI of the desired datatype
  Returns:
    Datatype the datatype definition registered at uri, if there is no such registered type it returns a new instance of the default datatype implementation, if the uri is null it returns null (indicating a plain RDF literal).

### getTypeByName

    public RDFDatatype getTypeByName(java.lang.String uri)

  Lookup a known datatype. An unkown datatype or a datatype with uri null will return null will mean that the value will be treated as a old-style plain literal.

  Parameters:
    `uri` - the URI of the desired datatype
  Returns:
    Datatype the datatype definition of null if not known.

### getTypeByValue

    public RDFDatatype getTypeByValue(java.lang.Object value)

  Method getTypeByValue. Look up a datatype suitable for representing the given java value object.

  Parameters:
    `value` - a value instance to be represented
  Returns:
    Datatype a datatype whose value space matches the java class of `value`

### listTypes

    public java.util.Iterator listTypes()

  List all the known datatypes

### registerDatatype

    public void registerDatatype(RDFDatatype type)

  Register a new datatype

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP