spark.data.io
Interface TypeFactory

All Known Implementing Classes:
TypeFactoryReflect, TypeFactorySimple

public interface TypeFactory

Spark IO is used to create external forms of spark values. For SO (object) and SA (array) values there is a need to map back and forth between the external form and the internal class structure. A TypeFactory performs this function. Various implementations of this interface can do this in various ways.

Author:
olsen

Method Summary
 java.lang.String externalTypeName(SO obj)
          This will return the externalTypeName to be used to represent the object externally.
 SA makeArray()
          SAs are not typed generally.
 SO makeObject(java.lang.String externalTypeName)
          Given an external type name this will create an SO of the correct internal type.
 

Method Detail

makeObject

SO makeObject(java.lang.String externalTypeName)
Given an external type name this will create an SO of the correct internal type.

Parameters:
externalTypeName - the name used in the external representation for an object type.
Returns:
an empty object ready to be filled. If the externalTypeName is not appropriate for some reason, then null is returned.

makeArray

SA makeArray()
SAs are not typed generally. The normal implementation is to return an SArray.

Returns:
an empty SA ready to be filled.

externalTypeName

java.lang.String externalTypeName(SO obj)
This will return the externalTypeName to be used to represent the object externally.

Parameters:
obj - the object whose type is to be represented.
Returns:
the type name to be used. If obj is a legal object that has no external type name, then an empty string is returned. If this object is not acceptable for output, then a null value is returned.