Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
TypeDescriptionFactory Class Reference

Public Member Functions

 _namespaceMap ($namespace)
instantiateTypeDescription ($typeDescription)
 TypeDescriptionFactory ()

Static Public Member Functions

static getInstance ()

Detailed Description

A factory class that takes a plain text type descriptor and instantiates the correct type description object based on the descriptor's namespace.

Definition at line 24 of file

Member Function Documentation

TypeDescriptionFactory::_namespaceMap (   $namespace)

Map a namespace to a fully qualified type descriptor class name.

FIXME: Move this map to the Application object.


Definition at line 105 of file

Referenced by instantiateTypeDescription().

static TypeDescriptionFactory::getInstance ( )
& TypeDescriptionFactory::instantiateTypeDescription (   $typeDescription)

Takes a plain text type descriptor, identifies the namespace and instantiates the corresponding type description object.

$typeDescriptionstring A plain text type description.

Type descriptions consist of two parts:

  • a type namespace
  • a type name (optionally including parameters like cardinality, etc.)

Example: primitive::string[5] -> namespace: primitive - type name: string[5]

Each namespace will be mapped to one subclass of the TypeDescription class which will then be responsible to parse the given type name.

TypeDescription or null if the type description is invalid.

Definition at line 74 of file

References _namespaceMap().

TypeDescriptionFactory::TypeDescriptionFactory ( )


NB: Should not be called directly! Always use getInstance().

Definition at line 31 of file

Referenced by getInstance().

The documentation for this class was generated from the following file: