de.hedenus.rdfschema
Class ResourceImpl

java.lang.Object
  extended by de.hedenus.rdfschema.ResourceImpl
All Implemented Interfaces:
Resource
Direct Known Subclasses:
Channel, ContainerImpl, Item, ListImpl, LiteralImpl, Ontology

public class ResourceImpl
extends java.lang.Object
implements Resource

Base implementation of a RDF bound Java object.

Author:
Michael Hedenus

Field Summary
 
Fields inherited from interface de.hedenus.rdfschema.Resource
URI
 
Constructor Summary
protected ResourceImpl()
           
 
Method Summary
 java.lang.String about()
          Returns the identifier of the resource, either its blank node ID or its URI.
protected  RDFDatabinding binding()
           
 Resource[] getProperties(java.lang.String propertyURI)
          Returns the values of the properties with the specified property-URI as an array of resources.
 Resource getProperty(java.lang.String propertyURI)
          Returns the first property with the specified property-URI.
 java.lang.String getProperty(java.lang.String propertyURI, java.util.Locale locale)
          Returns the literal property with the specified property-URI and locale.
 java.lang.Object getProperty(java.lang.String propertyURI, java.lang.String datatypeURI)
          Returns the first property value of the property with the specified property-URI.
protected  void init(RDFDatabinding binding, RDFNode node)
           
protected  RDFNode node()
          Returns the bound RDF node.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceImpl

protected ResourceImpl()
Method Detail

init

protected void init(RDFDatabinding binding,
                    RDFNode node)

binding

protected RDFDatabinding binding()

node

protected RDFNode node()
Returns the bound RDF node.


about

public java.lang.String about()
Description copied from interface: Resource
Returns the identifier of the resource, either its blank node ID or its URI.

Specified by:
about in interface Resource
Returns:
the resource identifier

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getProperty

public java.lang.Object getProperty(java.lang.String propertyURI,
                                    java.lang.String datatypeURI)
Description copied from interface: Resource
Returns the first property value of the property with the specified property-URI. If datatypeURI is null and the value is a plain literal, a string is returned. If the property value is a plain literal and datatypeURI is not null, the specified datatypeURI will be applied to convert the plain literal into a Java type. If the property value is typed literal, the specified datatype must match the datatype of the literal or an exception is thrown. If the value is not a literal but a URI reference or a blank node, a Resource object is returned.

Specified by:
getProperty in interface Resource
Parameters:
propertyURI - the property's URI
datatypeURI - the datatype's URI or null
Returns:
the property value or null if there is no statement that relates this resource with another by the specified property

getProperty

public java.lang.String getProperty(java.lang.String propertyURI,
                                    java.util.Locale locale)
Description copied from interface: Resource
Returns the literal property with the specified property-URI and locale. If the locale is null, the first matching literal property is returned. If locale is not null and there is no literal with a matching xml:lang attribute, null is returned.

Specified by:
getProperty in interface Resource
Parameters:
propertyURI - the property's URI
locale - the locale or null
Returns:
a matching literal property or null

getProperty

public Resource getProperty(java.lang.String propertyURI)
Description copied from interface: Resource
Returns the first property with the specified property-URI.

Specified by:
getProperty in interface Resource
Parameters:
propertyURI - the property's URI
Returns:
the value as Resource

getProperties

public Resource[] getProperties(java.lang.String propertyURI)
Description copied from interface: Resource
Returns the values of the properties with the specified property-URI as an array of resources. If there are no property values the array has length 0 (i.e. the result is never null).

Specified by:
getProperties in interface Resource
Parameters:
propertyURI - the property's URI
Returns:
the values as array of Resource objects