Class InitializrMetadataV2JsonMapper

java.lang.Object
io.spring.initializr.web.mapper.InitializrMetadataV2JsonMapper
All Implemented Interfaces:
InitializrMetadataJsonMapper
Direct Known Subclasses:
InitializrMetadataV21JsonMapper

public class InitializrMetadataV2JsonMapper extends Object implements InitializrMetadataJsonMapper
A InitializrMetadataJsonMapper handling the metadata format for v2.
Author:
Stephane Nicoll, Guillaume Gerbaud
  • Constructor Details

    • InitializrMetadataV2JsonMapper

      public InitializrMetadataV2JsonMapper()
  • Method Details

    • nodeFactory

      protected com.fasterxml.jackson.databind.node.JsonNodeFactory nodeFactory()
    • write

      public String write(InitializrMetadata metadata, String appUrl)
      Description copied from interface: InitializrMetadataJsonMapper
      Write a json representation of the specified metadata.
      Specified by:
      write in interface InitializrMetadataJsonMapper
      Parameters:
      metadata - the initializr metadata
      appUrl - the app URL
      Returns:
      the JSON representation
    • links

      protected com.fasterxml.jackson.databind.node.ObjectNode links(com.fasterxml.jackson.databind.node.ObjectNode parent, List<Type> types, String appUrl)
    • link

      protected com.fasterxml.jackson.databind.node.ObjectNode link(String appUrl, Type type)
    • dependencies

      protected void dependencies(com.fasterxml.jackson.databind.node.ObjectNode parent, DependenciesCapability capability)
    • type

      protected void type(com.fasterxml.jackson.databind.node.ObjectNode parent, TypeCapability capability)
    • singleSelect

      protected void singleSelect(com.fasterxml.jackson.databind.node.ObjectNode parent, SingleSelectCapability capability)
    • singleSelect

      @Deprecated protected void singleSelect(com.fasterxml.jackson.databind.node.ObjectNode parent, SingleSelectCapability capability, Function<MetadataElement,com.fasterxml.jackson.databind.node.ObjectNode> valueMapper)
      Map a SingleSelectCapability invoking the specified valueMapper.
      Parameters:
      parent - the parent node
      capability - the capability to map
      valueMapper - the function to invoke to transform one value of the capability
    • singleSelect

      protected void singleSelect(com.fasterxml.jackson.databind.node.ObjectNode parent, SingleSelectCapability capability, Function<MetadataElement,com.fasterxml.jackson.databind.node.ObjectNode> valueMapper, Function<String,String> defaultMapper)
    • text

      protected void text(com.fasterxml.jackson.databind.node.ObjectNode parent, TextCapability capability)
    • mapDependencyGroup

      protected com.fasterxml.jackson.databind.node.ObjectNode mapDependencyGroup(DependencyGroup group)
    • mapDependency

      protected com.fasterxml.jackson.databind.node.ObjectNode mapDependency(Dependency dependency)
    • mapType

      protected com.fasterxml.jackson.databind.node.ObjectNode mapType(Type type)
    • formatVersion

      protected String formatVersion(String versionId)
    • mapValue

      protected com.fasterxml.jackson.databind.node.ObjectNode mapValue(MetadataElement value)