org.apache.stanbol.enhancer.servicesapi.helper
Class RdfEntityFactory

java.lang.Object
  extended by org.apache.stanbol.enhancer.servicesapi.helper.RdfEntityFactory
Direct Known Subclasses:
SimpleRdfEntityFactory

public abstract class RdfEntityFactory
extends java.lang.Object

A Factory that creates proxies over rdf nodes.

Author:
Rupert Westenthaler

Constructor Summary
RdfEntityFactory()
           
 
Method Summary
static RdfEntityFactory createInstance(org.apache.clerezza.rdf.core.MGraph graph)
          Creates a new factory for the parsed MGraph instance.
abstract
<T extends RdfEntity>
T
getProxy(org.apache.clerezza.rdf.core.NonLiteral rdfNode, java.lang.Class<T> type, java.lang.Class<?>... additionalInterfaces)
          Getter for a proxy for the parsed rdf node that implements all the parsed Interfaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdfEntityFactory

public RdfEntityFactory()
Method Detail

createInstance

public static RdfEntityFactory createInstance(org.apache.clerezza.rdf.core.MGraph graph)
Creates a new factory for the parsed MGraph instance.

Parameters:
graph - the graph used by the proxies created by this factory to read/write there data
Returns:
the created factory

getProxy

public abstract <T extends RdfEntity> T getProxy(org.apache.clerezza.rdf.core.NonLiteral rdfNode,
                                                 java.lang.Class<T> type,
                                                 java.lang.Class<?>... additionalInterfaces)
                                      throws java.lang.IllegalArgumentException
Getter for a proxy for the parsed rdf node that implements all the parsed Interfaces. The interface parsed as type must extend RdfEntity. Additional interfaces must not extend this interface.

Interfaces parsed as parameter:

Proxies returned by this Factory:

Type Parameters:
T - The interface implemented by the returned proxy
Parameters:
rdfNode - the rdfNode represented by the proxy (created if not present in the Graph)
type - The interface for the proxy. Needs to extend RdfEntity
additionalInterfaces - Additional interfaces the proxy needs to implement.
Returns:
A proxy representing the parsed rdf node and implementing all the parsed interfaces
Throws:
java.lang.IllegalArgumentException - if the node is null or the parsed interfaces do not fulfil the requirements as stated.
java.lang.NullPointerException - if the parameter type, additionalInterfaces or any entry of additionalInterfaces is null.


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.