Class MarshallUtils

java.lang.Object
org.apache.juneau.marshall.marshaller.MarshallUtils

public final class MarshallUtils extends Object
Convenience static methods for serializing objects with all supported Juneau marshalling formats.

Designed for use with static imports to allow concise serialization code without explicitly referencing marshaller classes.

Examples:

import static org.apache.juneau.marshall.marshaller.MarshallUtils.*; // Serialize — char-based formats return String. String a = json(myBean); String b = json5(myBean); String c = xml(myBean); String d = html(myBean); String e = yaml(myBean); // Serialize — write to a stream. json(myBean, myWriter); // Serialize — binary formats return byte[]. byte[] f = msgPack(myBean); byte[] g = cbor(myBean); // Parse — same method names, overloaded by input type. MyBean b1 = json(jsonString, MyBean.class); MyBean b2 = xml(xmlString, MyBean.class); MyBean b3 = msgPack(bytes, MyBean.class); // Parse — parameterized types. List<MyBean> list = json(jsonString, List.class, MyBean.class);

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    bson(byte[] o, Class<T> c)
    Parses BSON bytes to the specified Java type.
    static <T> T
    bson(byte[] input, Type type, Type... args)
    Parses BSON bytes to the specified parameterized Java type.
    static byte[]
    bson(Object object)
    Serializes a Java object to BSON bytes.
    static <T> T
    bson(Object input, Class<T> type)
    Parses a BSON input to the specified Java type.
    static Object
    bson(Object object, Object output)
    Serializes a Java object to the specified BSON output.
    static <T> T
    bson(Object input, Type type, Type... args)
    Parses a BSON input to the specified parameterized Java type.
    static <T> T
    cbor(byte[] o, Class<T> c)
    Parses CBOR bytes to the specified Java type.
    static <T> T
    cbor(byte[] input, Type type, Type... args)
    Parses CBOR bytes to the specified parameterized Java type.
    static byte[]
    cbor(Object object)
    Serializes a Java object to CBOR bytes.
    static <T> T
    cbor(Object input, Class<T> type)
    Parses a CBOR input to the specified Java type.
    static Object
    cbor(Object object, Object output)
    Serializes a Java object to the specified CBOR output.
    static <T> T
    cbor(Object input, Type type, Type... args)
    Parses a CBOR input to the specified parameterized Java type.
    static String
    csv(Object object)
    Serializes a Java object to a CSV string.
    static <T> T
    csv(Object input, Class<T> type)
    Parses a CSV input to the specified Java type.
    static Object
    csv(Object object, Object output)
    Serializes a Java object to the specified CSV output.
    static <T> T
    csv(Object input, Type type, Type... args)
    Parses a CSV input to the specified parameterized Java type.
    static <T> T
    csv(String o, Class<T> c)
    Parses a CSV string to the specified Java type.
    static <T> T
    csv(String input, Type type, Type... args)
    Parses a CSV string to the specified parameterized Java type.
    static String
    hjson(Object object)
    Serializes a Java object to an HJSON string.
    static <T> T
    hjson(Object input, Class<T> type)
    Parses an HJSON input to the specified Java type.
    static Object
    hjson(Object object, Object output)
    Serializes a Java object to the specified HJSON output.
    static <T> T
    hjson(Object input, Type type, Type... args)
    Parses an HJSON input to the specified parameterized Java type.
    static <T> T
    hjson(String o, Class<T> c)
    Parses an HJSON string to the specified Java type.
    static <T> T
    hjson(String input, Type type, Type... args)
    Parses an HJSON string to the specified parameterized Java type.
    static String
    hocon(Object object)
    Serializes a Java object to a HOCON string.
    static <T> T
    hocon(Object input, Class<T> type)
    Parses a HOCON input to the specified Java type.
    static Object
    hocon(Object object, Object output)
    Serializes a Java object to the specified HOCON output.
    static <T> T
    hocon(Object input, Type type, Type... args)
    Parses a HOCON input to the specified parameterized Java type.
    static <T> T
    hocon(String o, Class<T> c)
    Parses a HOCON string to the specified Java type.
    static <T> T
    hocon(String input, Type type, Type... args)
    Parses a HOCON string to the specified parameterized Java type.
    static String
    html(Object object)
    Serializes a Java object to an HTML string.
    static <T> T
    html(Object input, Class<T> type)
    Parses an HTML input to the specified Java type.
    static Object
    html(Object object, Object output)
    Serializes a Java object to the specified HTML output.
    static <T> T
    html(Object input, Type type, Type... args)
    Parses an HTML input to the specified parameterized Java type.
    static <T> T
    html(String o, Class<T> c)
    Parses an HTML string to the specified Java type.
    static <T> T
    html(String input, Type type, Type... args)
    Parses an HTML string to the specified parameterized Java type.
    static String
    ini(Object object)
    Serializes a Java object to an INI/properties string.
    static <T> T
    ini(Object input, Class<T> type)
    Parses an INI/properties input to the specified Java type.
    static Object
    ini(Object object, Object output)
    Serializes a Java object to the specified INI/properties output.
    static <T> T
    ini(Object input, Type type, Type... args)
    Parses an INI/properties input to the specified parameterized Java type.
    static <T> T
    ini(String o, Class<T> c)
    Parses an INI/properties string to the specified Java type.
    static <T> T
    ini(String input, Type type, Type... args)
    Parses an INI/properties string to the specified parameterized Java type.
    static String
    jcs(Object object)
    Serializes a Java object to a canonical JSON string (RFC 8785).
    static <T> T
    jcs(Object input, Class<T> type)
    Parses a canonical JSON input to the specified Java type.
    static Object
    jcs(Object object, Object output)
    Serializes a Java object to the specified canonical JSON output.
    static <T> T
    jcs(Object input, Type type, Type... args)
    Parses a canonical JSON input to the specified parameterized Java type.
    static <T> T
    jcs(String o, Class<T> c)
    Parses a canonical JSON string (RFC 8785) to the specified Java type.
    static <T> T
    jcs(String input, Type type, Type... args)
    Parses a canonical JSON string (RFC 8785) to the specified parameterized Java type.
    static String
    json(Object object)
    Serializes a Java object to a JSON string.
    static <T> T
    json(Object input, Class<T> type)
    Parses a JSON input to the specified Java type.
    static Object
    json(Object object, Object output)
    Serializes a Java object to the specified JSON output.
    static <T> T
    json(Object input, Type type, Type... args)
    Parses a JSON input to the specified parameterized Java type.
    static <T> T
    json(String o, Class<T> c)
    Parses a JSON string to the specified Java type.
    static <T> T
    json(String input, Type type, Type... args)
    Parses a JSON string to the specified parameterized Java type.
    static String
    json5(Object object)
    Serializes a Java object to a JSON5 string.
    static <T> T
    json5(Object input, Class<T> type)
    Parses a JSON5 input to the specified Java type.
    static Object
    json5(Object object, Object output)
    Serializes a Java object to the specified JSON5 output.
    static <T> T
    json5(Object input, Type type, Type... args)
    Parses a JSON5 input to the specified parameterized Java type.
    static <T> T
    json5(String o, Class<T> c)
    Parses a JSON5 string to the specified Java type.
    static <T> T
    json5(String input, Type type, Type... args)
    Parses a JSON5 string to the specified parameterized Java type.
    static String
    jsonl(Object object)
    Serializes a Java object to a JSON Lines string.
    static <T> T
    jsonl(Object input, Class<T> type)
    Parses a JSON Lines input to the specified Java type.
    static Object
    jsonl(Object object, Object output)
    Serializes a Java object to the specified JSON Lines output.
    static <T> T
    jsonl(Object input, Type type, Type... args)
    Parses a JSON Lines input to the specified parameterized Java type.
    static <T> T
    jsonl(String o, Class<T> c)
    Parses a JSON Lines string to the specified Java type.
    static <T> T
    jsonl(String input, Type type, Type... args)
    Parses a JSON Lines string to the specified parameterized Java type.
    static String
    markdown(Object object)
    Serializes a Java object to an inline Markdown string.
    static <T> T
    markdown(Object input, Class<T> type)
    Parses a Markdown input to the specified Java type.
    static Object
    markdown(Object object, Object output)
    Serializes a Java object to the specified Markdown output.
    static <T> T
    markdown(Object input, Type type, Type... args)
    Parses a Markdown input to the specified parameterized Java type.
    static <T> T
    markdown(String o, Class<T> c)
    Parses an inline Markdown string to the specified Java type.
    static <T> T
    markdown(String input, Type type, Type... args)
    Parses an inline Markdown string to the specified parameterized Java type.
    static String
    Serializes a Java object to a document-mode Markdown string (headings + tables).
    static <T> T
    markdownDoc(Object input, Class<T> type)
    Parses a document-mode Markdown input to the specified Java type.
    static Object
    markdownDoc(Object object, Object output)
    Serializes a Java object to the specified document-mode Markdown output.
    static <T> T
    markdownDoc(Object input, Type type, Type... args)
    Parses a document-mode Markdown input to the specified parameterized Java type.
    static <T> T
    Parses a document-mode Markdown string to the specified Java type.
    static <T> T
    markdownDoc(String input, Type type, Type... args)
    Parses a document-mode Markdown string to the specified parameterized Java type.
    static <T> T
    msgPack(byte[] o, Class<T> c)
    Parses MessagePack bytes to the specified Java type.
    static <T> T
    msgPack(byte[] input, Type type, Type... args)
    Parses MessagePack bytes to the specified parameterized Java type.
    static byte[]
    msgPack(Object object)
    Serializes a Java object to MessagePack bytes.
    static <T> T
    msgPack(Object input, Class<T> type)
    Parses a MessagePack input to the specified Java type.
    static Object
    msgPack(Object object, Object output)
    Serializes a Java object to the specified MessagePack output.
    static <T> T
    msgPack(Object input, Type type, Type... args)
    Parses a MessagePack input to the specified parameterized Java type.
    static String
    openApi(Object object)
    Serializes a Java object to an OpenAPI string.
    static <T> T
    openApi(Object input, Class<T> type)
    Parses an OpenAPI input to the specified Java type.
    static Object
    openApi(Object object, Object output)
    Serializes a Java object to the specified OpenAPI output.
    static <T> T
    openApi(Object input, Type type, Type... args)
    Parses an OpenAPI input to the specified parameterized Java type.
    static <T> T
    openApi(String o, Class<T> c)
    Parses an OpenAPI string to the specified Java type.
    static <T> T
    openApi(String input, Type type, Type... args)
    Parses an OpenAPI string to the specified parameterized Java type.
    static <T> List<T>
    parquet(byte[] o, Class<T> c)
    Parses Apache Parquet bytes to a list of the specified Java type.
    static <T> List<T>
    parquet(byte[] input, Type type)
    Parses Apache Parquet bytes to a list of the specified element type.
    static <T> T
    parquet(byte[] input, Type type, Type... args)
    Parses Apache Parquet bytes to the specified parameterized Java type.
    static byte[]
    parquet(Object object)
    Serializes a Java object to Apache Parquet bytes.
    static <T> List<T>
    parquet(Object input, Class<T> type)
    Parses a Parquet input to a list of the specified Java type.
    static Object
    parquet(Object object, Object output)
    Serializes a Java object to the specified Parquet output.
    static String
    plainText(Object object)
    Serializes a Java object to a plain-text string.
    static <T> T
    plainText(Object input, Class<T> type)
    Parses a plain-text input to the specified Java type.
    static Object
    plainText(Object object, Object output)
    Serializes a Java object to the specified plain-text output.
    static <T> T
    plainText(Object input, Type type, Type... args)
    Parses a plain-text input to the specified parameterized Java type.
    static <T> T
    Parses a plain-text string to the specified Java type.
    static <T> T
    plainText(String input, Type type, Type... args)
    Parses a plain-text string to the specified parameterized Java type.
    static String
    proto(Object object)
    Serializes a Java object to a Protocol Buffers text string.
    static <T> T
    proto(Object input, Class<T> type)
    Parses a Protocol Buffers input to the specified Java type.
    static Object
    proto(Object object, Object output)
    Serializes a Java object to the specified Protocol Buffers output.
    static <T> T
    proto(Object input, Type type, Type... args)
    Parses a Protocol Buffers input to the specified parameterized Java type.
    static <T> T
    proto(String o, Class<T> c)
    Parses a Protocol Buffers text string to the specified Java type.
    static <T> T
    proto(String input, Type type, Type... args)
    Parses a Protocol Buffers text string to the specified parameterized Java type.
    static String
    toml(Object object)
    Serializes a Java object to a TOML string.
    static <T> T
    toml(Object input, Class<T> type)
    Parses a TOML input to the specified Java type.
    static Object
    toml(Object object, Object output)
    Serializes a Java object to the specified TOML output.
    static <T> T
    toml(Object input, Type type, Type... args)
    Parses a TOML input to the specified parameterized Java type.
    static <T> T
    toml(String o, Class<T> c)
    Parses a TOML string to the specified Java type.
    static <T> T
    toml(String input, Type type, Type... args)
    Parses a TOML string to the specified parameterized Java type.
    static String
    uon(Object object)
    Serializes a Java object to a UON string.
    static <T> T
    uon(Object input, Class<T> type)
    Parses a UON input to the specified Java type.
    static Object
    uon(Object object, Object output)
    Serializes a Java object to the specified UON output.
    static <T> T
    uon(Object input, Type type, Type... args)
    Parses a UON input to the specified parameterized Java type.
    static <T> T
    uon(String o, Class<T> c)
    Parses a UON string to the specified Java type.
    static <T> T
    uon(String input, Type type, Type... args)
    Parses a UON string to the specified parameterized Java type.
    static String
    Serializes a Java object to a URL-encoding string.
    static <T> T
    urlEncoding(Object input, Class<T> type)
    Parses a URL-encoding input to the specified Java type.
    static Object
    urlEncoding(Object object, Object output)
    Serializes a Java object to the specified URL-encoding output.
    static <T> T
    urlEncoding(Object input, Type type, Type... args)
    Parses a URL-encoding input to the specified parameterized Java type.
    static <T> T
    Parses a URL-encoding string to the specified Java type.
    static <T> T
    urlEncoding(String input, Type type, Type... args)
    Parses a URL-encoding string to the specified parameterized Java type.
    static String
    xml(Object object)
    Serializes a Java object to an XML string.
    static <T> T
    xml(Object input, Class<T> type)
    Parses an XML input to the specified Java type.
    static Object
    xml(Object object, Object output)
    Serializes a Java object to the specified XML output.
    static <T> T
    xml(Object input, Type type, Type... args)
    Parses an XML input to the specified parameterized Java type.
    static <T> T
    xml(String o, Class<T> c)
    Parses an XML string to the specified Java type.
    static <T> T
    xml(String input, Type type, Type... args)
    Parses an XML string to the specified parameterized Java type.
    static String
    yaml(Object object)
    Serializes a Java object to a YAML string.
    static <T> T
    yaml(Object input, Class<T> type)
    Parses a YAML input to the specified Java type.
    static Object
    yaml(Object object, Object output)
    Serializes a Java object to the specified YAML output.
    static <T> T
    yaml(Object input, Type type, Type... args)
    Parses a YAML input to the specified parameterized Java type.
    static <T> T
    yaml(String o, Class<T> c)
    Parses a YAML string to the specified Java type.
    static <T> T
    yaml(String input, Type type, Type... args)
    Parses a YAML string to the specified parameterized Java type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • json

      public static String json(Object object) throws SerializeException
      Serializes a Java object to a JSON string.

      A shortcut for calling Json.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • json

      public static Object json(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified JSON output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • json

      public static <T> T json(Object input, Class<T> type) throws ParseException, IOException
      Parses a JSON input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • json

      public static <T> T json(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a JSON input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • json

      public static <T> T json(String o, Class<T> c)
      Parses a JSON string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The JSON input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • json

      public static <T> T json(String input, Type type, Type... args) throws ParseException
      Parses a JSON string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The JSON input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • json5

      public static String json5(Object object) throws SerializeException
      Serializes a Java object to a JSON5 string.

      A shortcut for calling Json5.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • json5

      public static Object json5(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified JSON5 output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • json5

      public static <T> T json5(Object input, Class<T> type) throws ParseException, IOException
      Parses a JSON5 input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • json5

      public static <T> T json5(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a JSON5 input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • json5

      public static <T> T json5(String o, Class<T> c)
      Parses a JSON5 string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The JSON5 input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • json5

      public static <T> T json5(String input, Type type, Type... args) throws ParseException
      Parses a JSON5 string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The JSON5 input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • jsonl

      public static String jsonl(Object object) throws SerializeException
      Serializes a Java object to a JSON Lines string.

      A shortcut for calling Jsonl.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • jsonl

      public static Object jsonl(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified JSON Lines output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • jsonl

      public static <T> T jsonl(Object input, Class<T> type) throws ParseException, IOException
      Parses a JSON Lines input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • jsonl

      public static <T> T jsonl(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a JSON Lines input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • jsonl

      public static <T> T jsonl(String o, Class<T> c)
      Parses a JSON Lines string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The JSON Lines input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • jsonl

      public static <T> T jsonl(String input, Type type, Type... args) throws ParseException
      Parses a JSON Lines string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The JSON Lines input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • jcs

      public static String jcs(Object object) throws SerializeException
      Serializes a Java object to a canonical JSON string (RFC 8785).

      A shortcut for calling Jcs.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • jcs

      public static Object jcs(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified canonical JSON output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • jcs

      public static <T> T jcs(Object input, Class<T> type) throws ParseException, IOException
      Parses a canonical JSON input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • jcs

      public static <T> T jcs(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a canonical JSON input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • jcs

      public static <T> T jcs(String o, Class<T> c)
      Parses a canonical JSON string (RFC 8785) to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The JCS input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • jcs

      public static <T> T jcs(String input, Type type, Type... args) throws ParseException
      Parses a canonical JSON string (RFC 8785) to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The JCS input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • hjson

      public static String hjson(Object object) throws SerializeException
      Serializes a Java object to an HJSON string.

      A shortcut for calling Hjson.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • hjson

      public static Object hjson(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified HJSON output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • hjson

      public static <T> T hjson(Object input, Class<T> type) throws ParseException, IOException
      Parses an HJSON input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • hjson

      public static <T> T hjson(Object input, Type type, Type... args) throws ParseException, IOException
      Parses an HJSON input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • hjson

      public static <T> T hjson(String o, Class<T> c)
      Parses an HJSON string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The HJSON input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • hjson

      public static <T> T hjson(String input, Type type, Type... args) throws ParseException
      Parses an HJSON string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The HJSON input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • xml

      public static String xml(Object object) throws SerializeException
      Serializes a Java object to an XML string.

      A shortcut for calling Xml.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • xml

      public static Object xml(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified XML output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • xml

      public static <T> T xml(Object input, Class<T> type) throws ParseException, IOException
      Parses an XML input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • xml

      public static <T> T xml(Object input, Type type, Type... args) throws ParseException, IOException
      Parses an XML input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • xml

      public static <T> T xml(String o, Class<T> c)
      Parses an XML string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The XML input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • xml

      public static <T> T xml(String input, Type type, Type... args) throws ParseException
      Parses an XML string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The XML input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • html

      public static String html(Object object) throws SerializeException
      Serializes a Java object to an HTML string.

      A shortcut for calling Html.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • html

      public static Object html(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified HTML output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • html

      public static <T> T html(Object input, Class<T> type) throws ParseException, IOException
      Parses an HTML input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • html

      public static <T> T html(Object input, Type type, Type... args) throws ParseException, IOException
      Parses an HTML input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • html

      public static <T> T html(String o, Class<T> c)
      Parses an HTML string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The HTML input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • html

      public static <T> T html(String input, Type type, Type... args) throws ParseException
      Parses an HTML string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The HTML input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • uon

      public static String uon(Object object) throws SerializeException
      Serializes a Java object to a UON string.

      A shortcut for calling Uon.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • uon

      public static Object uon(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified UON output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • uon

      public static <T> T uon(Object input, Class<T> type) throws ParseException, IOException
      Parses a UON input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • uon

      public static <T> T uon(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a UON input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • uon

      public static <T> T uon(String o, Class<T> c)
      Parses a UON string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The UON input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • uon

      public static <T> T uon(String input, Type type, Type... args) throws ParseException
      Parses a UON string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The UON input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • urlEncoding

      public static String urlEncoding(Object object) throws SerializeException
      Serializes a Java object to a URL-encoding string.

      A shortcut for calling UrlEncoding.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • urlEncoding

      public static Object urlEncoding(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified URL-encoding output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • urlEncoding

      public static <T> T urlEncoding(Object input, Class<T> type) throws ParseException, IOException
      Parses a URL-encoding input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • urlEncoding

      public static <T> T urlEncoding(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a URL-encoding input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • urlEncoding

      public static <T> T urlEncoding(String o, Class<T> c)
      Parses a URL-encoding string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The URL-encoding input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • urlEncoding

      public static <T> T urlEncoding(String input, Type type, Type... args) throws ParseException
      Parses a URL-encoding string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The URL-encoding input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • yaml

      public static String yaml(Object object) throws SerializeException
      Serializes a Java object to a YAML string.

      A shortcut for calling Yaml.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • yaml

      public static Object yaml(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified YAML output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • yaml

      public static <T> T yaml(Object input, Class<T> type) throws ParseException, IOException
      Parses a YAML input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • yaml

      public static <T> T yaml(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a YAML input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • yaml

      public static <T> T yaml(String o, Class<T> c)
      Parses a YAML string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The YAML input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • yaml

      public static <T> T yaml(String input, Type type, Type... args) throws ParseException
      Parses a YAML string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The YAML input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • csv

      public static String csv(Object object) throws SerializeException
      Serializes a Java object to a CSV string.

      A shortcut for calling Csv.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • csv

      public static Object csv(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified CSV output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • csv

      public static <T> T csv(Object input, Class<T> type) throws ParseException, IOException
      Parses a CSV input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • csv

      public static <T> T csv(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a CSV input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • csv

      public static <T> T csv(String o, Class<T> c)
      Parses a CSV string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The CSV input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • csv

      public static <T> T csv(String input, Type type, Type... args) throws ParseException
      Parses a CSV string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The CSV input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • openApi

      public static String openApi(Object object) throws SerializeException
      Serializes a Java object to an OpenAPI string.

      A shortcut for calling OpenApi.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • openApi

      public static Object openApi(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified OpenAPI output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • openApi

      public static <T> T openApi(Object input, Class<T> type) throws ParseException, IOException
      Parses an OpenAPI input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • openApi

      public static <T> T openApi(Object input, Type type, Type... args) throws ParseException, IOException
      Parses an OpenAPI input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • openApi

      public static <T> T openApi(String o, Class<T> c)
      Parses an OpenAPI string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The OpenAPI input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • openApi

      public static <T> T openApi(String input, Type type, Type... args) throws ParseException
      Parses an OpenAPI string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The OpenAPI input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • plainText

      public static String plainText(Object object) throws SerializeException
      Serializes a Java object to a plain-text string.

      A shortcut for calling PlainText.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • plainText

      public static Object plainText(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified plain-text output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • plainText

      public static <T> T plainText(Object input, Class<T> type) throws ParseException, IOException
      Parses a plain-text input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • plainText

      public static <T> T plainText(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a plain-text input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • plainText

      public static <T> T plainText(String o, Class<T> c)
      Parses a plain-text string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The plain-text input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • plainText

      public static <T> T plainText(String input, Type type, Type... args) throws ParseException
      Parses a plain-text string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The plain-text input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • markdown

      public static String markdown(Object object) throws SerializeException
      Serializes a Java object to an inline Markdown string.

      A shortcut for calling Markdown.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • markdown

      public static Object markdown(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified Markdown output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • markdown

      public static <T> T markdown(Object input, Class<T> type) throws ParseException, IOException
      Parses a Markdown input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • markdown

      public static <T> T markdown(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a Markdown input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • markdown

      public static <T> T markdown(String o, Class<T> c)
      Parses an inline Markdown string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The Markdown input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • markdown

      public static <T> T markdown(String input, Type type, Type... args) throws ParseException
      Parses an inline Markdown string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The Markdown input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • markdownDoc

      public static String markdownDoc(Object object) throws SerializeException
      Serializes a Java object to a document-mode Markdown string (headings + tables).

      A shortcut for calling MarkdownDoc.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • markdownDoc

      public static Object markdownDoc(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified document-mode Markdown output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • markdownDoc

      public static <T> T markdownDoc(Object input, Class<T> type) throws ParseException, IOException
      Parses a document-mode Markdown input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • markdownDoc

      public static <T> T markdownDoc(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a document-mode Markdown input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • markdownDoc

      public static <T> T markdownDoc(String o, Class<T> c)
      Parses a document-mode Markdown string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The Markdown input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • markdownDoc

      public static <T> T markdownDoc(String input, Type type, Type... args) throws ParseException
      Parses a document-mode Markdown string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The Markdown input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • ini

      public static String ini(Object object) throws SerializeException
      Serializes a Java object to an INI/properties string.

      A shortcut for calling Ini.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • ini

      public static Object ini(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified INI/properties output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • ini

      public static <T> T ini(Object input, Class<T> type) throws ParseException, IOException
      Parses an INI/properties input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • ini

      public static <T> T ini(Object input, Type type, Type... args) throws ParseException, IOException
      Parses an INI/properties input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • ini

      public static <T> T ini(String o, Class<T> c)
      Parses an INI/properties string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The INI input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • ini

      public static <T> T ini(String input, Type type, Type... args) throws ParseException
      Parses an INI/properties string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The INI input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • toml

      public static String toml(Object object) throws SerializeException
      Serializes a Java object to a TOML string.

      A shortcut for calling Toml.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • toml

      public static Object toml(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified TOML output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • toml

      public static <T> T toml(Object input, Class<T> type) throws ParseException, IOException
      Parses a TOML input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • toml

      public static <T> T toml(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a TOML input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • toml

      public static <T> T toml(String o, Class<T> c)
      Parses a TOML string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The TOML input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • toml

      public static <T> T toml(String input, Type type, Type... args) throws ParseException
      Parses a TOML string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The TOML input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • hocon

      public static String hocon(Object object) throws SerializeException
      Serializes a Java object to a HOCON string.

      A shortcut for calling Hocon.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • hocon

      public static Object hocon(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified HOCON output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • hocon

      public static <T> T hocon(Object input, Class<T> type) throws ParseException, IOException
      Parses a HOCON input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • hocon

      public static <T> T hocon(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a HOCON input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • hocon

      public static <T> T hocon(String o, Class<T> c)
      Parses a HOCON string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The HOCON input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • hocon

      public static <T> T hocon(String input, Type type, Type... args) throws ParseException
      Parses a HOCON string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The HOCON input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • proto

      public static String proto(Object object) throws SerializeException
      Serializes a Java object to a Protocol Buffers text string.

      A shortcut for calling Prototext.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • proto

      public static Object proto(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified Protocol Buffers output.
      Parameters:
      object - The object to serialize.
      output - The output object (Writer, OutputStream, File, or StringBuilder).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • proto

      public static <T> T proto(Object input, Class<T> type) throws ParseException, IOException
      Parses a Protocol Buffers input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • proto

      public static <T> T proto(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a Protocol Buffers input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (Reader, CharSequence, InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • proto

      public static <T> T proto(String o, Class<T> c)
      Parses a Protocol Buffers text string to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The Prototext input string.
      c - The object type to create.
      Returns:
      The parsed object.
    • proto

      public static <T> T proto(String input, Type type, Type... args) throws ParseException
      Parses a Protocol Buffers text string to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The Prototext input string.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • msgPack

      public static byte[] msgPack(Object object) throws SerializeException
      Serializes a Java object to MessagePack bytes.

      A shortcut for calling MsgPack.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • msgPack

      public static Object msgPack(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified MessagePack output.
      Parameters:
      object - The object to serialize.
      output - The output object (OutputStream or File).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • msgPack

      public static <T> T msgPack(Object input, Class<T> type) throws ParseException, IOException
      Parses a MessagePack input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • msgPack

      public static <T> T msgPack(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a MessagePack input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • msgPack

      public static <T> T msgPack(byte[] o, Class<T> c)
      Parses MessagePack bytes to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The MessagePack input bytes.
      c - The object type to create.
      Returns:
      The parsed object.
    • msgPack

      public static <T> T msgPack(byte[] input, Type type, Type... args) throws ParseException
      Parses MessagePack bytes to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The MessagePack input bytes.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • cbor

      public static byte[] cbor(Object object) throws SerializeException
      Serializes a Java object to CBOR bytes.

      A shortcut for calling Cbor.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • cbor

      public static Object cbor(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified CBOR output.
      Parameters:
      object - The object to serialize.
      output - The output object (OutputStream or File).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • cbor

      public static <T> T cbor(Object input, Class<T> type) throws ParseException, IOException
      Parses a CBOR input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • cbor

      public static <T> T cbor(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a CBOR input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • cbor

      public static <T> T cbor(byte[] o, Class<T> c)
      Parses CBOR bytes to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The CBOR input bytes.
      c - The object type to create.
      Returns:
      The parsed object.
    • cbor

      public static <T> T cbor(byte[] input, Type type, Type... args) throws ParseException
      Parses CBOR bytes to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The CBOR input bytes.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • bson

      public static byte[] bson(Object object) throws SerializeException
      Serializes a Java object to BSON bytes.

      A shortcut for calling Bson.of(object).

      Parameters:
      object - The object to serialize.
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • bson

      public static Object bson(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified BSON output.
      Parameters:
      object - The object to serialize.
      output - The output object (OutputStream or File).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • bson

      public static <T> T bson(Object input, Class<T> type) throws ParseException, IOException
      Parses a BSON input to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (InputStream, byte[], or File).
      type - The object type to create.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • bson

      public static <T> T bson(Object input, Type type, Type... args) throws ParseException, IOException
      Parses a BSON input to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The input (InputStream, byte[], or File).
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • bson

      public static <T> T bson(byte[] o, Class<T> c)
      Parses BSON bytes to the specified Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      o - The BSON input bytes.
      c - The object type to create.
      Returns:
      The parsed object.
    • bson

      public static <T> T bson(byte[] input, Type type, Type... args) throws ParseException
      Parses BSON bytes to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The BSON input bytes.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.
    • parquet

      public static byte[] parquet(Object object) throws SerializeException
      Serializes a Java object to Apache Parquet bytes.

      A shortcut for calling Parquet.of(object).

      Note: Parquet is collection-oriented. A single bean is automatically wrapped in a one-element list.

      Parameters:
      object - The object to serialize (Collection, array, or single bean).
      Returns:
      The serialized object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
    • parquet

      public static Object parquet(Object object, Object output) throws SerializeException, IOException
      Serializes a Java object to the specified Parquet output.
      Parameters:
      object - The object to serialize.
      output - The output object (OutputStream or File).
      Returns:
      The output object.
      Throws:
      SerializeException - If a problem occurred trying to convert the output.
      IOException - Thrown by underlying stream.
    • parquet

      public static <T> List<T> parquet(Object input, Class<T> type) throws ParseException, IOException
      Parses a Parquet input to a list of the specified Java type.

      Note: Parquet always returns a List; the parser never returns a bare instance.

      Type Parameters:
      T - The element type.
      Parameters:
      input - The input (InputStream, byte[], or File).
      type - The bean class (parser returns List<T>).
      Returns:
      The parsed list of beans.
      Throws:
      ParseException - Malformed input encountered.
      IOException - Thrown by underlying stream.
    • parquet

      public static <T> List<T> parquet(byte[] o, Class<T> c)
      Parses Apache Parquet bytes to a list of the specified Java type.

      Note: Parquet always returns a List; the parser never returns a bare instance.

      Type Parameters:
      T - The element type.
      Parameters:
      o - The Parquet input bytes.
      c - The bean class (parser returns List<T>).
      Returns:
      The parsed list of beans.
    • parquet

      public static <T> List<T> parquet(byte[] input, Type type) throws ParseException
      Parses Apache Parquet bytes to a list of the specified element type.
      Type Parameters:
      T - The element type.
      Parameters:
      input - The Parquet input bytes.
      type - The element type (parser returns List<T>).
      Returns:
      The parsed list.
      Throws:
      ParseException - Malformed input encountered.
    • parquet

      public static <T> T parquet(byte[] input, Type type, Type... args) throws ParseException
      Parses Apache Parquet bytes to the specified parameterized Java type.
      Type Parameters:
      T - The class type of the object being created.
      Parameters:
      input - The Parquet input bytes.
      type - The object type to create.
      args - The type arguments of the class if it's a collection or map.
      Returns:
      The parsed object.
      Throws:
      ParseException - Malformed input encountered.