org.openrdf.elmo
Class ElmoModule

java.lang.Object
  extended by org.openrdf.elmo.ElmoModule

public class ElmoModule
extends Object

Defines the Scope of an ElmoManager and its factory. This includes roles, literals, factories, datasets, and contexts.

Author:
James Leigh

Nested Class Summary
static class ElmoModule.Association
           
 
Constructor Summary
ElmoModule()
           
 
Method Summary
 ElmoModule addDataset(URL dataset)
          Marks this dataset to be loaded into the repository under a context of the same URL.
 ElmoModule addDataset(URL dataset, String context)
          Marks this dataset to be loaded and replace any data in the given context.
 ElmoModule addResources(String path)
          Load a dataset or a resource listing dataset - optionally assigned to a context
 boolean equals(Object obj)
           
 QName getContext()
           
 List<QName> getContexts()
           
 Map<URL,String> getDatasets()
           
 List<ElmoModule.Association> getFactories()
           
 List<ElmoModule.Association> getLiterals()
           
 List<ElmoBehaviourFactory<?>> getRecordedFactoryInstances()
           
 List<String> getResources()
           
 List<ElmoModule.Association> getRoles()
           
 int hashCode()
           
 ElmoModule includeModule(ElmoModule module)
          Include all the information from the given module in this module.
 ElmoModule recordFactory(Class<?> role)
          Associates this factory with its default subject type.
 ElmoModule recordFactory(Class<?> role, String type)
          Associates this factory with the given subject type.
<B> ElmoModule
recordFactory(ElmoBehaviourFactory<B> factory)
          Deprecated. Use recordFactory(Class) instead
 ElmoModule recordLiteral(Class<?> type, String datatype)
          Associates this literal type with the given datatype within this factory.
 ElmoModule recordRole(Class<?> role)
          Associates this role with its default subject type.
 ElmoModule recordRole(Class<?> role, String type)
          Associates this role with the given subject type.
 ElmoModule setContext(QName context)
          Sets the primary context of this module.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElmoModule

public ElmoModule()
Method Detail

getContext

public QName getContext()

setContext

public ElmoModule setContext(QName context)
Sets the primary context of this module. This limits the readable scope to this and other included contexts and causes any add operations to be saved in this context.

Parameters:
context -
Returns:
this

includeModule

public ElmoModule includeModule(ElmoModule module)
Include all the information from the given module in this module.

Parameters:
module - to be included
Returns:
this

getContexts

public List<QName> getContexts()

getLiterals

public List<ElmoModule.Association> getLiterals()

recordLiteral

public ElmoModule recordLiteral(Class<?> type,
                                String datatype)
Associates this literal type with the given datatype within this factory.

Parameters:
type - serializable class
datatype - URI

getRoles

public List<ElmoModule.Association> getRoles()

recordRole

public ElmoModule recordRole(Class<?> role)
Associates this role with its default subject type.

Parameters:
role - concept or behaviour

recordRole

public ElmoModule recordRole(Class<?> role,
                             String type)
Associates this role with the given subject type.

Parameters:
role - concept or behaviour
type - URI

getRecordedFactoryInstances

public List<ElmoBehaviourFactory<?>> getRecordedFactoryInstances()

recordFactory

public <B> ElmoModule recordFactory(ElmoBehaviourFactory<B> factory)
Deprecated. Use recordFactory(Class) instead

Registers a factory instance used to created a behaviour.

Type Parameters:
B - Behaviour class
Parameters:
factory - Behaviour factory used to create behaviours

getFactories

public List<ElmoModule.Association> getFactories()

recordFactory

public ElmoModule recordFactory(Class<?> role)
Associates this factory with its default subject type.

Parameters:
role - concept or behaviour

recordFactory

public ElmoModule recordFactory(Class<?> role,
                                String type)
Associates this factory with the given subject type.

Parameters:
role - concept or behaviour
type - URI

getDatasets

public Map<URL,String> getDatasets()

addDataset

public ElmoModule addDataset(URL dataset)
Marks this dataset to be loaded into the repository under a context of the same URL.

Parameters:
dataset -
Returns:
this

addDataset

public ElmoModule addDataset(URL dataset,
                             String context)
Marks this dataset to be loaded and replace any data in the given context.

Parameters:
dataset -
context -
Returns:
this

getResources

public List<String> getResources()

addResources

public ElmoModule addResources(String path)
Load a dataset or a resource listing dataset - optionally assigned to a context

Parameters:
path -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2007. All Rights Reserved.