spark.data.io
Class TypeFactorySimple

java.lang.Object
  extended by spark.data.io.TypeFactorySimple
All Implemented Interfaces:
TypeFactory

public class TypeFactorySimple
extends java.lang.Object
implements TypeFactory

This TypeFactory will always use SObj and SArray for its objects. However, for SObj values it will put the external type name into a "type:" attribute.

Author:
olsen

Constructor Summary
TypeFactorySimple()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeFactorySimple

public TypeFactorySimple()
Method Detail

makeObject

public SO makeObject(java.lang.String externalTypeName)
Description copied from interface: TypeFactory
Given an external type name this will create an SO of the correct internal type.

Specified by:
makeObject in interface TypeFactory
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

public SA makeArray()
Description copied from interface: TypeFactory
SAs are not typed generally. The normal implementation is to return an SArray.

Specified by:
makeArray in interface TypeFactory
Returns:
an empty SA ready to be filled.

externalTypeName

public java.lang.String externalTypeName(SO obj)
Description copied from interface: TypeFactory
This will return the externalTypeName to be used to represent the object externally.

Specified by:
externalTypeName in interface TypeFactory
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.