/**
  * Populates an empty UriContextCollection with UriContexts.
  *
  * @param $uriContextCollection UriContextCollection
  */
 public function build(UriContextCollection $uriContextCollection)
 {
     $subjectObject = $uriContextCollection->getSubjectObject();
     $realClassName = $this->adapter->getRealClassName(get_class($subjectObject));
     $metadata = $this->metadataFactory->getMetadataForClass($realClassName);
     // TODO: This is where we will call $metadata->getUriSchemas() which will return an
     //       array of URI schemas (inc. the "template", TP configs and CR configs).
     $definitions = $metadata->getAutoRouteDefinitions();
     foreach ($definitions as $definition) {
         $locales = $this->adapter->getLocales($subjectObject) ?: array(null);
         foreach ($locales as $locale) {
             // create and add uri context to stack
             $uriContext = $uriContextCollection->createUriContext($definition->getUriSchema(), $definition->getDefaults(), $metadata->getTokenProviders(), $metadata->getConflictResolver(), $locale);
             $uriContextCollection->addUriContext($uriContext);
         }
     }
 }