* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class XmlObjectRegistryTemplateEngine extends BaseTemplateEngine implements CompileableTemplate, Registerable {
+ // Constants
+ const OBJECT_TYPE_DATA_NAME = 'object-name';
+ const OBJECT_TYPE_DATA_RECIPIENT_LIMITATION = 'object-recipient-limitation';
+ const OBJECT_TYPE_DATA_MAX_SPREAD = 'object-max-spread';
+ const OBJECT_TYPE_DATA_PROTOCOL = 'object-protocol';
+ const OBJECT_TYPE_DATA_RECIPIENT_TYPE = 'object-recipient-type';
+
/**
* Instance for the object registry
*/
private $subNodes = array(
'object-list',
'object-list-entry',
- 'object-name',
- 'object-recipient-limitation',
- 'object-max-spread',
- 'object-protocol',
- 'object-recipient-type'
+ self::OBJECT_TYPE_DATA_NAME,
+ self::OBJECT_TYPE_DATA_RECIPIENT_LIMITATION,
+ self::OBJECT_TYPE_DATA_MAX_SPREAD,
+ self::OBJECT_TYPE_DATA_PROTOCOL,
+ self::OBJECT_TYPE_DATA_RECIPIENT_TYPE
);
/**
parent::__construct(__CLASS__);
// Init object type registry instance
- $this->objectRegistryInstance = ObjectFactory::createObjectByConfiguredName('node_object_type_registry_class');
+ $this->objectRegistryInstance = ObjectTypeRegistryFactory::createObjectTypeRegistryInstance();
}
/**
// Get current XML node name as an array index
$nodeName = $this->getStackerInstance()->getNamed('object_registry');
- // Is the node name 'object-name'?
- if ($nodeName == 'object-name') {
+ // Is the node name self::OBJECT_TYPE_DATA_NAME?
+ if ($nodeName == self::OBJECT_TYPE_DATA_NAME) {
// Output debug message
self::createDebugInstance(__CLASS__)->debugOutput('TAGS: Adding object type ' . $characters . ' to registry.');
} // END - if
*/
private function startObjectName () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('object_registry', 'object-name');
+ $this->getStackerInstance()->pushNamed('object_registry', self::OBJECT_TYPE_DATA_NAME);
}
/**
*/
private function startObjectRecipientLimitation () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('object_registry', 'object-recipient-limitation');
+ $this->getStackerInstance()->pushNamed('object_registry', self::OBJECT_TYPE_DATA_RECIPIENT_LIMITATION);
}
/**
*/
private function startObjectMaxSpread () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('object_registry', 'object-max-spread');
+ $this->getStackerInstance()->pushNamed('object_registry', self::OBJECT_TYPE_DATA_MAX_SPREAD);
}
/**
*/
private function startObjectProtocol () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('object_registry', 'object-protocol');
+ $this->getStackerInstance()->pushNamed('object_registry', self::OBJECT_TYPE_DATA_PROTOCOL);
}
/**
*/
private function startObjectRecipientType () {
// Push the node name on the stacker
- $this->getStackerInstance()->pushNamed('object_registry', 'object-recipient-type');
+ $this->getStackerInstance()->pushNamed('object_registry', self::OBJECT_TYPE_DATA_RECIPIENT_TYPE);
}
/**