org.nodal.type
Interface TypeFactory

All Known Subinterfaces:
MapType.Editor, NodeType.Editor, RecordType.Editor, RestrictionType.Editor, Schema.Editor, SequenceType.Editor, UnionType.Editor

public interface TypeFactory

Generic interface for creating new Types.

Author:
Lee Iverson

Method Summary
 MapType.Editor createMapType(Type keyType, Type valueType)
          Create a MapType reference with the given key and value types.
 RecordType.Editor createRecordType()
          Create a RecordType reference.
 RecordType.Editor createRecordType(RecordType ext)
          Create a RecordType reference that extends the RecordType ext..
 RestrictionType.Editor createRestrictionType(Type base)
          Create a RestrictionType reference with the given base type.
 SequenceType.Editor createSequenceType(Type elemType)
          Create a SequenceType reference with the given element type restriction..
 UnionType.Editor createUnionType()
          Create a UnionType reference (initially empty).
 

Method Detail

createMapType

public MapType.Editor createMapType(Type keyType,
                                    Type valueType)
Create a MapType reference with the given key and value types.

Parameters:
keyType - the type of the keys in this MapType
valueType - the type of the values in this MapType
Returns:
an editor for the newly created MapType

createSequenceType

public SequenceType.Editor createSequenceType(Type elemType)
Create a SequenceType reference with the given element type restriction..

Parameters:
elemType - the type of elements of these Sequences
Returns:
an editor for the newly created SequenceType

createRecordType

public RecordType.Editor createRecordType()
Create a RecordType reference.

Returns:
an editor for the newly created RecordType

createRecordType

public RecordType.Editor createRecordType(RecordType ext)
Create a RecordType reference that extends the RecordType ext..

Parameters:
ext - the RecordType being extended with this definition
Returns:
an editor for the newly created RecordType

createUnionType

public UnionType.Editor createUnionType()
Create a UnionType reference (initially empty).

Returns:
an editor for the newly created UnionType

createRestrictionType

public RestrictionType.Editor createRestrictionType(Type base)
Create a RestrictionType reference with the given base type.

Parameters:
base - the type that is being restricted
Returns:
an editor for the newly created RestrictionType