uk.ac.cam.spectra
Class LiteralProperty

java.lang.Object
  extended by uk.ac.cam.spectra.LiteralProperty
All Implemented Interfaces:
java.io.Serializable, MetadataProperty
Direct Known Subclasses:
DateProperty, IntegerProperty

public class LiteralProperty
extends java.lang.Object
implements MetadataProperty

Basic literal property, supporting string value literals.

Author:
Jim Downing
See Also:
Serialized Form

Field Summary
protected  java.lang.String element
           
protected  java.lang.String namespace
           
 
Constructor Summary
LiteralProperty(java.lang.String ns, java.lang.String el)
           
 
Method Summary
 void add(com.hp.hpl.jena.rdf.model.Resource resource, java.lang.Object value)
           
 com.hp.hpl.jena.rdf.model.Property asProperty(com.hp.hpl.jena.rdf.model.Model m)
           
 java.lang.String decode(com.hp.hpl.jena.rdf.model.RDFNode value)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getElement()
          Predicate element name.
 java.lang.String getNamespace()
          Predicate namespace.
 java.lang.String getXsiType()
          Base literals don't have an xsi type.
 int hashCode()
           
 boolean isLiteral()
           
 java.net.URI toURI()
          Get predicate URI.
 java.lang.String toURIString()
          Convenience method when dealing with frameworks that model uris as strings.
 boolean valid(com.hp.hpl.jena.rdf.model.RDFNode value, com.hp.hpl.jena.rdf.model.Model m)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespace

protected java.lang.String namespace

element

protected java.lang.String element
Constructor Detail

LiteralProperty

public LiteralProperty(java.lang.String ns,
                       java.lang.String el)
Method Detail

getElement

public java.lang.String getElement()
Description copied from interface: MetadataProperty
Predicate element name.

Specified by:
getElement in interface MetadataProperty
Returns:

getNamespace

public java.lang.String getNamespace()
Description copied from interface: MetadataProperty
Predicate namespace.

Specified by:
getNamespace in interface MetadataProperty
Returns:

getXsiType

public java.lang.String getXsiType()
Base literals don't have an xsi type.

Specified by:
getXsiType in interface MetadataProperty

toURI

public java.net.URI toURI()
Description copied from interface: MetadataProperty
Get predicate URI.

Specified by:
toURI in interface MetadataProperty
Returns:

toURIString

public java.lang.String toURIString()
Description copied from interface: MetadataProperty
Convenience method when dealing with frameworks that model uris as strings.

Specified by:
toURIString in interface MetadataProperty
Returns:

isLiteral

public final boolean isLiteral()
Specified by:
isLiteral in interface MetadataProperty

valid

public boolean valid(com.hp.hpl.jena.rdf.model.RDFNode value,
                     com.hp.hpl.jena.rdf.model.Model m)
Specified by:
valid in interface MetadataProperty
Parameters:
value - the value you wish to set
m - the target RDF model

asProperty

public com.hp.hpl.jena.rdf.model.Property asProperty(com.hp.hpl.jena.rdf.model.Model m)
Specified by:
asProperty in interface MetadataProperty

decode

public java.lang.String decode(com.hp.hpl.jena.rdf.model.RDFNode value)
Specified by:
decode in interface MetadataProperty

add

public void add(com.hp.hpl.jena.rdf.model.Resource resource,
                java.lang.Object value)
Specified by:
add in interface MetadataProperty

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2006-2007 The SPECTRa Project. All Rights Reserved.