Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
TypeDescription Class Reference
Inheritance diagram for TypeDescription:
ClassTypeDescription PrimitiveTypeDescription XMLTypeDescription MetadataTypeDescription ValidatorTypeDescription

Public Member Functions

 _parseTypeNameInternally ($typeName)
 checkType (&$object)
 getNamespace ()
 getTypeDescription ()
 getTypeName ()
 isCompatible (&$object)
 parseTypeName ($typeName)
 TypeDescription ($typeName)

Detailed Description

Abstract base class for filter input/output type descriptions.

Filter type specifications need to fulfill the following requirements: 1) They must uniquely and reliably identify the input/output types supported by a filter. 2) They must be flexible enough to deal with type polymorphism (e.g. a generic XSL filter may accept several XML input formats while a specialized crosswalk filter may only accept a very specific XML encoding as input) or inheritance (e.g. when checking the class of an object). 3) Type definitions must be consistent across all filters (even those contributed by community plugins). 4) Type descriptions must be flexible enough so that new types can always be introduced, even by the community. 5) Type descriptions should have a unique string representation that is easy to read by humans and can be persisted. The string must contain all information necessary to instantiate the type description object.

String representations of type descriptions consist of two parts:

  • the first part identifies the type description class
  • the second part contains parameters that a specific type description class needs to actually check a type The two parts are separated by a double colon.

Example: "primitive::string"

See Also
TypeDescriptionFactory for more details about the type description string representation.
FilterDAO for more details about how type descriptions are used to choose compatible filters for a given input/output type.

Definition at line 49 of file

Member Function Documentation

TypeDescription::_parseTypeNameInternally (   $typeName)

Takes a type name and parses the cardinality part of it then delegate to the subclass to do the type-specific parsing.


Definition at line 191 of file

References parseTypeName().

Referenced by TypeDescription().

TypeDescription::checkType ( $object)

Validates an object against the internal type description.


Definition at line 175 of file

Referenced by isCompatible().

TypeDescription::getNamespace ( )

Get the type description's namespace string


Definition at line 89 of file

Referenced by getTypeDescription(), and TypeDescription().

TypeDescription::getTypeDescription ( )

Get the full unparsed type description


Definition at line 106 of file

References getNamespace(), and getTypeName().

TypeDescription::getTypeName ( )

Get the unparsed type name


Definition at line 98 of file

Referenced by getTypeDescription().

TypeDescription::isCompatible ( $object)

Checks whether the given object complies with the type description.


Definition at line 120 of file

References checkType().

TypeDescription::parseTypeName (   $typeName)

Parse a type name

boolean true if success, otherwise false

Definition at line 164 of file

Referenced by _parseTypeNameInternally().

TypeDescription::TypeDescription (   $typeName)


$typeNamestring A plain text type name to be parsed by this type description class.

Type names can be any string. This base class provides a basic implementation for type cardinality (array-types) which can be re-used by all subclasses.

We currently do not support heterogeneous or multi-dimensional arrays because we don't have corresponding use cases. We may, however, expand our syntax later to accommodate that.

If you do not know the exact count of an array then you can leave the parentheses empty ([]).

Definition at line 73 of file

References _parseTypeNameInternally(), and getNamespace().

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