4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Serializer\Mapping\Factory;
14 use Symfony\Component\Serializer\Exception\InvalidArgumentException;
15 use Symfony\Component\Serializer\Mapping\ClassMetadataInterface;
18 * Returns a {@see ClassMetadataInterface}.
20 * @author Kévin Dunglas <dunglas@gmail.com>
22 interface ClassMetadataFactoryInterface
25 * If the method was called with the same class name (or an object of that
26 * class) before, the same metadata instance is returned.
28 * If the factory was configured with a cache, this method will first look
29 * for an existing metadata instance in the cache. If an existing instance
30 * is found, it will be returned without further ado.
32 * Otherwise, a new metadata instance is created. If the factory was
33 * configured with a loader, the metadata is passed to the
34 * {@link \Symfony\Component\Serializer\Mapping\Loader\LoaderInterface::loadClassMetadata()} method for further
35 * configuration. At last, the new object is returned.
37 * @param string|object $value
39 * @return ClassMetadataInterface
41 * @throws InvalidArgumentException
43 public function getMetadataFor($value);
46 * Checks if class has metadata.
52 public function hasMetadataFor($value);