Best way to serialize composite – (design pattern)

I have following java code that is implementation of Composite Design pattern: //composite designed for type safety (all Leaf-only operations only in leaf) interface Component extends Visitable { …

Serialization process constantly overwrites itself?

I’m fairly new to java and trying to do some serialization in my project. I have a bunch of objects called Student and I would like to serialize them. The code I’m using for this is as follows: try{ …

JSON parse error: Cannot deserialize instance of ArrayList

I’m trying to send a JSON to a POST bodyRequest service to use this information as a Java ArrayList or something like that. When I try to do it, I receive a deserialize error This is my JSON: {…

Unable to load a groovy classes

I am trying to serialize and deserialize a groovy object with the below class in the jenkins pipeline. SerializationUtil.groovy package com.sample; import java.io.FileInputStream; import java.io….

Serial version uid in abstract exception class

I have a base custom exception class BaseException public class BaseException extends RuntimeException { } and several custom exceptions that extends BaseException public class CustomException …

Dynamic serialization using Jackson – removing fields with specific annotations

Went down a path of creating an annotation that would dynamic determine whether a field should be serialized or not. The annotation’s implementation is as follows: @Retention(RetentionPolicy.RUNTIME) @…

Is there any stable serialization method for different languages?

In my project we have an API, and many clients may send transactions to this API. Transactions should be signed. Clients may be written in any language (C++, C#, python, go, whatever), with any CPU …

Jackson Serialize Field to Different Name

I have this JSON to deserialize: { “first-name”: “Alpha”, “last-name”: “Beta”, “gender”: “m” } I want to serialize it to 2 different formats: [A] { “first-name”: “Alpha”, “last-…

Java XML serialization error: Invalid UTF-16 Surrogate detected

I have an org.w3c.dom.Document and want to serialize it with this function, but I get an SAXException. How could I fix this? public static String serializeXmlDocument(Document document) throws …

Jackson JSON custom serialization for certain fields

Is there a way using Jackson JSON Processor to do custom field level serialization? For example, I’d like to have the class public class Person { public String name; public int age; …