Class MBStyleParser

Object
MBStyleParser

public class MBStyleParser extends Object
Given JSON input (as a String or Reader, parses and returns a MBStyle.
Author:
Torben Barsballe (Boundless)
  • Constructor Details

    • MBStyleParser

      public MBStyleParser()
  • Method Details

    • parse

      public MBStyle parse(String json) throws ParseException, MBFormatException
      Parse the provided json into MBStyle.

      Please be aware that MBStyle.is a thin wrapper around the provided json and will lazily parse map box style contents as required.

      Parameters:
      json - String
      Returns:
      MBStyle
      Throws:
      ParseException - If JSON is not well formed
      MBFormatException - If MapBox Style is obviously not well formed
    • parse

      public MBStyle parse(Reader json) throws ParseException, IOException, MBFormatException
      Parse the provided json into MBStyle.

      Please be aware that MBStyle.is a thin wrapper around the provided json and will lazily parse map box style contents as required.

      Parameters:
      json - Reader
      Returns:
      MBStyle
      Throws:
      ParseException - If JSON is not well formed
      IOException - If json reader cannot be read
      MBFormatException - If MapBox Style is obviously not well formed
    • parse

      public MBStyle parse(InputStream json) throws ParseException, IOException, MBFormatException
      Parse the provided json into MBStyle.

      Please be aware that MBStyle.is a thin wrapper around the provided json and will lazily parse map box style contents as required.

      Parameters:
      json - InputStream
      Returns:
      MBStyle
      Throws:
      ParseException - If JSON is not well formed
      IOException - If json input stream cannot be read
      MBFormatException - If MapBox Style is obviously not well formed