code: private TypeMetadata createTypeMetadata(AnnotatedType annotatedType) {
          Class<?> currentClass = annotatedType.getAnnotatedElement();
          Collection<AnnotatedMethod> annotatedMethods = this.annotatedMethods.get(currentClass);
          if (annotatedMethods == null) {
              throw new XOException("XO unit does not declare '" + currentClass.getName() + "'.");
          }
          Collection<MethodMetadata<?, ?>> methodMetadataOfType = getMethodMetadataOfType(annotatedType, annotatedMethods);
          TypeMetadata metadata;
          List<TypeMetadata> superTypes = getSuperTypeMetadata(annotatedType);
          if (isEntityType(annotatedType)) {
              metadata = createEntityTypeMetadata(annotatedType, superTypes, methodMetadataOfType);
          } else if (isRelationType(annotatedType)) {
              metadata = createRelationTypeMetadata(annotatedType, superTypes, methodMetadataOfType);
          } else if (annotatedType.isAnnotationPresent(Repository.class)) {
              metadata = createRepositoryTypeMetadata(annotatedType, superTypes, methodMetadataOfType);
          } else {
              IndexedPropertyMethodMetadata indexedProperty = getIndexedPropertyMethodMetadata(methodMetadataOfType);
              metadata = new SimpleTypeMetadata(annotatedType, superTypes, methodMetadataOfType, indexedProperty);
          }
          return metadata;
      }
docs: Create the {@link TypeMetadata} for the given {@link AnnotatedType}.
  
  @param annotatedType
  The {@link AnnotatedType}.
  @return The corresponding metadata.