Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
TypeDescriptionFactory Class Reference

Public Member Functions

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

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 TypeDescriptionFactory.inc.php.

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.

Parameters
$namespacestring
Returns
string

Definition at line 105 of file TypeDescriptionFactory.inc.php.

Referenced by instantiateTypeDescription().

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

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

Parameters
$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.

Returns
TypeDescription or null if the type description is invalid.

Definition at line 74 of file TypeDescriptionFactory.inc.php.

References _namespaceMap().

TypeDescriptionFactory::TypeDescriptionFactory ( )

Constructor

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

Definition at line 31 of file TypeDescriptionFactory.inc.php.

Referenced by getInstance().


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