10 defined(
'JPATH_PLATFORM') or die;
25 protected static $instances = array();
38 public static function getInstance($type)
41 $type = strtolower(preg_replace(
'/[^A-Z0-9_]/i',
'', $type));
44 if (!isset(self::$instances[$type]))
47 $class =
'JRegistryFormat' . $type;
49 if (!class_exists($class))
51 $path = __DIR__ .
'/format/' . $type .
'.php';
59 throw new InvalidArgumentException(
'Unable to load format class.', 500);
63 self::$instances[$type] =
new $class;
66 return self::$instances[$type];
79 abstract public function objectToString($object, $options = null);
91 abstract public function stringToObject($data, array $options = array());