Skip to main content

Default Swaps

By default, all serializers and parsers have built in ObjectSwaps defined for the following common data types:

note

As of 10.0.0, Iterator, Iterable, Stream, and Enumeration types are serialized natively without swaps. The IteratorSwap and EnumerationSwap classes have been removed. See Release 10.0.0 for details.

note

As of 10.0.0, date/time types (Calendar, Date, Temporal subtypes, XMLGregorianCalendar) and Duration are serialized and parsed natively as ISO 8601 strings without swaps. The default swap registrations for these types have been removed from this list. The old swap classes (TemporalCalendarSwap, TemporalDateSwap, CalendarSwap, DateSwap, TemporalSwap) have been removed; to customize the output format (e.g. RFC 1123 instead of ISO 8601) use @MarshalledProp(calendarFormat=...) / @Marshalled(calendarFormat=...) / MarshallingContext.Builder.calendarFormat(CalendarFormat...), or register your own ObjectSwap. See Release 10.0.0 for details.

Locale Class TimeZone ZoneId

The following types are now handled natively (built-in ISO 8601 support, no swap required):

Calendar Date Instant ZonedDateTime LocalDate LocalDateTime LocalTime OffsetDateTime OffsetTime Year YearMonth Temporal XMLGregorianCalendar Duration

Various other swaps are provided in the org.apache.juneau.marshall.swaps package.