org.openrdf.elmo.rolemapper
Class RoleMapperImpl<URI>

java.lang.Object
  extended by org.openrdf.elmo.rolemapper.RoleMapperImpl<URI>
All Implemented Interfaces:
RoleMapper<URI>

public class RoleMapperImpl<URI>
extends Object
implements RoleMapper<URI>


Constructor Summary
RoleMapperImpl(ComplexMapper<URI> roleMapper)
           
 
Method Summary
 void addFactory(Class<?> javaClass)
           
 void addFactory(Class<?> javaClass, String type)
           
 void addRole(Class<?> role)
           
 void addRole(Class<?> role, String type)
           
 Class<?>[] findBaseRoles()
          Roles that should be included by any bean.
 Collection<Class<?>> findIndividualRoles(URI instance, Collection<Class<?>> classes)
          Adds roles to the collection that are specific to this instance.
 Collection<Class<?>> findRoles(Collection<URI> types, Collection<Class<?>> roles)
          Finds all the roles that should be implemented by these types.
 Class<?>[] findRoles(URI type)
          Finds the Java Class for this rdf:Class.
 Collection<URI> findSubTypes(Class<?> role, Collection<URI> rdfTypes)
          Finds the rdf:types for concept and any sub-concept(s).
 URI findType(Class<?> concept)
          Finds the rdf:Class for this Java Class.
 Collection<URI> findTypes(Class<?> role, Collection<URI> rdfTypes)
          Finds the rdf:types that this interface or class represents.
 boolean isIndividualRolesPresent(URI instance)
          Determines if a registered role hase this value as a {link org.openrdf.annotations.oneOf} value.
 boolean isTypeRecorded(URI type)
          Finds if there exists a Java Class for this rdf:Class.
 void setRdfTypeFactory(RdfTypeFactory<URI> vf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleMapperImpl

public RoleMapperImpl(ComplexMapper<URI> roleMapper)
Method Detail

setRdfTypeFactory

public void setRdfTypeFactory(RdfTypeFactory<URI> vf)
Specified by:
setRdfTypeFactory in interface RoleMapper<URI>

findBaseRoles

public Class<?>[] findBaseRoles()
Description copied from interface: RoleMapper
Roles that should be included by any bean. Used when the resource has no rdf:type.

Specified by:
findBaseRoles in interface RoleMapper<URI>
Returns:
roles implemented by all Beans.

findIndividualRoles

public Collection<Class<?>> findIndividualRoles(URI instance,
                                                Collection<Class<?>> classes)
Description copied from interface: RoleMapper
Adds roles to the collection that are specific to this instance. Defined with the {link org.openrdf.annotations.oneOf} annotation.

Specified by:
findIndividualRoles in interface RoleMapper<URI>
Returns:
classes

findRoles

public Class<?>[] findRoles(URI type)
Description copied from interface: RoleMapper
Finds the Java Class for this rdf:Class. Searches for register classes.

Specified by:
findRoles in interface RoleMapper<URI>

findRoles

public Collection<Class<?>> findRoles(Collection<URI> types,
                                      Collection<Class<?>> roles)
Description copied from interface: RoleMapper
Finds all the roles that should be implemented by these types.

Specified by:
findRoles in interface RoleMapper<URI>
Parameters:
types - rdf:types
roles - collection should be used to add the classes.
Returns:
roles

findSubTypes

public Collection<URI> findSubTypes(Class<?> role,
                                    Collection<URI> rdfTypes)
Description copied from interface: RoleMapper
Finds the rdf:types for concept and any sub-concept(s).

Specified by:
findSubTypes in interface RoleMapper<URI>
Returns:
rdfTypes

findType

public URI findType(Class<?> concept)
Description copied from interface: RoleMapper
Finds the rdf:Class for this Java Class.

Specified by:
findType in interface RoleMapper<URI>
Returns:
URI of the rdf:Class for this Java Class or null.

findTypes

public Collection<URI> findTypes(Class<?> role,
                                 Collection<URI> rdfTypes)
Description copied from interface: RoleMapper
Finds the rdf:types that this interface or class represents.

Specified by:
findTypes in interface RoleMapper<URI>
Returns:
rdfTypes

isIndividualRolesPresent

public boolean isIndividualRolesPresent(URI instance)
Description copied from interface: RoleMapper
Determines if a registered role hase this value as a {link org.openrdf.annotations.oneOf} value.

Specified by:
isIndividualRolesPresent in interface RoleMapper<URI>
Returns:
true if {link RoleMapper.findIndividualRoles(Object, Collection) will modify the collection.

isTypeRecorded

public boolean isTypeRecorded(URI type)
Description copied from interface: RoleMapper
Finds if there exists a Java Class for this rdf:Class. Searches for register classes.

Specified by:
isTypeRecorded in interface RoleMapper<URI>

addFactory

public void addFactory(Class<?> javaClass)
Specified by:
addFactory in interface RoleMapper<URI>

addFactory

public void addFactory(Class<?> javaClass,
                       String type)
Specified by:
addFactory in interface RoleMapper<URI>

addRole

public void addRole(Class<?> role)
Specified by:
addRole in interface RoleMapper<URI>

addRole

public void addRole(Class<?> role,
                    String type)
Specified by:
addRole in interface RoleMapper<URI>


Copyright © 2004-2008 Aduna. All Rights Reserved.