Class JsonDescriptorScanner

  • All Implemented Interfaces:
    de.griefed.serverpackcreator.api.modscanning.ModJarScanner

    
    public abstract class JsonDescriptorScanner
    extends DescriptorScanner
                        

    Base for scanners whose descriptor is JSON: adds Jackson reading to the per-jar failure handling of DescriptorScanner, so subclasses implement read for a single jar and may throw freely.

    Author:

    Griefed

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getScanAnnouncement()
      final JsonNode getJarJson(File file, String entryInJar, ObjectMapper objectMapper) Acquire a JsonNode from the specified entry in the specified jar.
      • Methods inherited from class de.griefed.serverpackcreator.api.modscanning.DescriptorScanner

        read, scan
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonDescriptorScanner

        JsonDescriptorScanner()
    • Method Detail

      • getJarJson

         final JsonNode getJarJson(File file, String entryInJar, ObjectMapper objectMapper)

        Acquire a JsonNode from the specified entry in the specified jar.

        Parameters:
        file - The jar from which to get the JsonNode.
        entryInJar - The entry in the jar from which to get the JsonNode.
        objectMapper - The ObjectMapper with which to parse the JSON to a JsonNode.
        Returns:

        A JsonNode containing all information from the requested entry in the specified jar.