{title:'Marshallers'}

{@link oaj.marshaller.Marshaller Marshallers} are simple pairings of a {@link oaj.serializer.Serializer} and {@link oaj.parser.Parser} with convenience methods for serializing and parsing POJOs.

- {@link oaj.marshaller.Marshaller}
  - T {@link oaj.marshaller.Marshaller#read(Object,Class) read(Object,Class<T>)}
  - {@link oaj.marshaller.CharMarshaller}
    - String {@link oaj.marshaller.CharMarshaller#write(Object) write(Object)}
      - {@link oaj.marshaller.Csv}
      - {@link oaj.marshaller.Html}
      - {@link oaj.marshaller.Json}
      - {@link oaj.marshaller.OpenApi}
      - {@link oaj.marshaller.PlainText}
      - {@link oaj.marshaller.Json5}
      - {@link oaj.marshaller.Uon}
      - {@link oaj.marshaller.UrlEncoding}
      - {@link oaj.marshaller.Xml}
  - {@link oaj.marshaller.StreamMarshaller}
    - byte[] {@link oaj.marshaller.StreamMarshaller#write(Object) write(Object)}
      - {@link oaj.marshaller.MsgPack}

##### Examples:

| // Using instance. | Json json = new Json(); | MyPojo myPojo = json.read(string, MyPojo. class); | String string = json.write(myPojo);

| // Using DEFAULT instance. | MyPojo myPojo = Json. DEFAULT.read(string, MyPojo. class); | String string = Json. DEFAULT.write(myPojo);

Juneau comes with the following predefined marshallers:

- {@link oaj.marshaller.Csv}
- {@link oaj.marshaller.Html}
- {@link oaj.marshaller.Json}
- {@link oaj.marshaller.MsgPack}
- {@link oaj.marshaller.OpenApi}
- {@link oaj.marshaller.PlainText}
- {@link oaj.marshaller.Json5}
- {@link oaj.marshaller.Uon}
- {@link oaj.marshaller.UrlEncoding}
- {@link oaj.marshaller.Xml}

Each predefined marshaller also includes static convenience from/to methods to make it even easier to perform marshalling on POJOs:

- {@link oaj.marshaller.Json}
  - String {@link oaj.marshaller.Json#of(Object) of(Object)}
  - T {@link oaj.marshaller.Json#to(Object,Class) to(Object,Class<T>)}

##### Examples:

| // Using shortcut static methods. | MyPojo myPojo = Json. to(jsonString, MyPojo. class); | String json = Json. of(myPojo);