Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct ($typeName) | |
_parseTypeNameInternally ($typeName) | |
checkType (&$object) | |
getNamespace () | |
getTypeDescription () | |
getTypeName () | |
isCompatible ($object) | |
parseTypeName ($typeName) | |
Data Fields | |
$_cardinality | |
$_typeName | |
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:
Example: "primitive::string"
Definition at line 49 of file TypeDescription.inc.php.
TypeDescription::__construct | ( | $typeName | ) |
Constructor
$typeName | string 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 ([]).
Reimplemented in XMLTypeDescription, MetadataTypeDescription, ClassTypeDescription, ValidatorTypeDescription, and PrimitiveTypeDescription.
Definition at line 79 of file TypeDescription.inc.php.
References _parseTypeNameInternally(), fatalError(), and getNamespace().
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.
$typeName | string |
Definition at line 197 of file TypeDescription.inc.php.
References parseTypeName().
Referenced by __construct().
TypeDescription::checkType | ( | & | $object | ) |
Validates an object against the internal type description.
$object | mixed |
Reimplemented in MetadataTypeDescription, XMLTypeDescription, ValidatorTypeDescription, ClassTypeDescription, and PrimitiveTypeDescription.
Definition at line 181 of file TypeDescription.inc.php.
Referenced by isCompatible().
TypeDescription::getNamespace | ( | ) |
Get the type description's namespace string
Reimplemented in XMLTypeDescription, MetadataTypeDescription, ValidatorTypeDescription, ClassTypeDescription, and PrimitiveTypeDescription.
Definition at line 95 of file TypeDescription.inc.php.
Referenced by __construct(), and getTypeDescription().
TypeDescription::getTypeDescription | ( | ) |
Get the full unparsed type description
Definition at line 112 of file TypeDescription.inc.php.
References getNamespace(), and getTypeName().
TypeDescription::getTypeName | ( | ) |
Get the unparsed type name
Definition at line 104 of file TypeDescription.inc.php.
References $_typeName.
Referenced by getTypeDescription().
TypeDescription::isCompatible | ( | $object | ) |
Checks whether the given object complies with the type description.
$object | mixed |
Definition at line 126 of file TypeDescription.inc.php.
References checkType().
TypeDescription::parseTypeName | ( | $typeName | ) |
Parse a type name
$typeName | string |
Reimplemented in MetadataTypeDescription, XMLTypeDescription, ValidatorTypeDescription, ClassTypeDescription, and PrimitiveTypeDescription.
Definition at line 170 of file TypeDescription.inc.php.
Referenced by _parseTypeNameInternally().
integer TypeDescription::$_cardinality |
the cardinality of the type
Definition at line 60 of file TypeDescription.inc.php.
string TypeDescription::$_typeName |
the unparsed type name
Definition at line 54 of file TypeDescription.inc.php.
Referenced by getTypeName().