eu.larkc.core.data.serialization
Interface Parameters

All Superinterfaces:
InformationSet, java.io.Serializable, SetOfStatements

public interface Parameters
extends SetOfStatements

Parameters is a helper type used to automate the serialization/deserialization of InformationSet to and from RDF data.

Author:
vassil

Method Summary
 CloseableIterator<org.openrdf.model.Statement> getStatements()
          Iterates the statements.
 InformationSet read(java.lang.Class<? extends InformationSet> parameterType)
          Reads a parameters from the RDF statements.
 InformationSet read(java.lang.Class<? extends InformationSet> parameterType, org.openrdf.model.URI parameterName)
          Reads a parameters from the RDF statements.
 InformationSet[] readAll(java.lang.Class<? extends InformationSet> parameterType)
          Returns all objects from a specified type that could be constructed from this RDF data.
 SetOfStatements toRDF(SetOfStatements data)
          Serializes this object to SetOfStatements.
 void write(InformationSet parameter)
          Writes parameter to RDF data using a auto-generated parameterName.
 void write(InformationSet parameter, org.openrdf.model.URI parameterName)
          Writes parameter to RDF data using a explicit parameterName.
 

Method Detail

write

void write(InformationSet parameter,
           org.openrdf.model.URI parameterName)
Writes parameter to RDF data using a explicit parameterName. The parameterName should be always used to identify different parameters from the same type.

Parameters:
parameter - to be serialized
parameterName - parameter overloading

write

void write(InformationSet parameter)
Writes parameter to RDF data using a auto-generated parameterName. This method should be used if each parameterType is used only one time.

Parameters:
parameter - to be serialized

read

InformationSet read(java.lang.Class<? extends InformationSet> parameterType)
Reads a parameters from the RDF statements. This method returns the first occurrence of the type.

Parameters:
parameterType - type to be constructed
Returns:
constructed type or null

read

InformationSet read(java.lang.Class<? extends InformationSet> parameterType,
                    org.openrdf.model.URI parameterName)
Reads a parameters from the RDF statements. This method returns the first occurrence of the type with the specified parameterName.

Parameters:
parameterType - type to be constructed
parameterName - is used to distinguish parameter overloading
Returns:
constructed type or null

readAll

InformationSet[] readAll(java.lang.Class<? extends InformationSet> parameterType)
Returns all objects from a specified type that could be constructed from this RDF data.

Parameters:
parameterType - type to be constructed
Returns:
list of types

getStatements

CloseableIterator<org.openrdf.model.Statement> getStatements()
Description copied from interface: SetOfStatements
Iterates the statements.

Specified by:
getStatements in interface SetOfStatements
Returns:
closeableiterator over the statements.s

toRDF

SetOfStatements toRDF(SetOfStatements data)
Description copied from interface: InformationSet
Serializes this object to SetOfStatements.

Specified by:
toRDF in interface InformationSet
Parameters:
data - is stream to serialize this object to.
Returns:
reference to the set of statements that contains the serialized data.