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()
           
ElmoModule(ClassLoader cl)
           
 
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 addFactory(Class<?> role)
          Associates this factory with its default subject type.
 ElmoModule addFactory(Class<?> role, String type)
          Associates this factory with the given subject type.
 ElmoModule addJarFileUrl(URL jarFile)
           
 ElmoModule addLiteral(Class<?> type, String datatype)
          Associates this literal type with the given datatype within this factory.
 ElmoModule addResources(String path)
          Load a dataset or a resource listing dataset - optionally assigned to a context
 ElmoModule addRole(Class<?> role)
          Associates this role with its default subject type.
 ElmoModule addRole(Class<?> role, String type)
          Associates this role with the given subject type.
 boolean equals(Object obj)
           
 ClassLoader getClassLoader()
           
 QName getContext()
           
 List<QName> getContexts()
           
 Map<URL,String> getDatasets()
           
 List<ElmoModule.Association> getFactories()
           
 List<URL> getJarFileUrls()
           
 List<ElmoModule.Association> getLiterals()
           
 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 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()

ElmoModule

public ElmoModule(ClassLoader cl)
Method Detail

getClassLoader

public ClassLoader getClassLoader()

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()

addLiteral

public ElmoModule addLiteral(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()

addRole

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

Parameters:
role - concept or behaviour

addRole

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

Parameters:
role - concept or behaviour
type - URI

getFactories

public List<ElmoModule.Association> getFactories()

addFactory

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

Parameters:
role - concept or behaviour

addFactory

public ElmoModule addFactory(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:

getJarFileUrls

public List<URL> getJarFileUrls()

addJarFileUrl

public ElmoModule addJarFileUrl(URL jarFile)

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-2008 Aduna. All Rights Reserved.