Skip to content
English

Java 8+ Open Source

SJF4J

Treat Java Objects Like JSON

A unified structural processing layer built on JSON semantics.

LicenseMaven CentralJavadocSupported JSON Schema dialects
JSON Schema Draft 2020-12 complianceJSON Schema Draft 2019-09 complianceJSON Schema Draft 7 compliance

Runtime Flexibility, Compiled Speed

Enjoy flexible runtime APIs and highly optimized compile-time code generation — explore features and performance.

Explore Features

Work directly with Java objects using flexible Runtime APIs and optimized Compiled APIs.

Binding

Unified data binding across JSON, YAML, and Java Properties, supporting POJOs, Maps, Lists, generic types, and custom value types.

Runtime APIJava
public class User {
    public String name;
    public int age;
    public Address address;
}
public class Address {
    public String city;
}
Sjf4j sjf4j = Sjf4j.builder().build();

User user = sjf4j.fromJson(json, User.class);
String json2 = sjf4j.toJsonString(user);
Compiled APIJava
@CompiledBinder
interface UserBinder {
    @Read User fromJson(String json);
    @Write String toJson(User user);
}
UserBinder binder = CompiledInstances.create(UserBinder.class);

User user = binder.fromJson(json);
String json2 = binder.toJson(user);

SJF4J's open streaming architecture supports custom data formats and backends. Its rich binding capabilities include @OneOf polymorphism, multi-format ValueCodec support, and fully managed ExternalNode integration.

Learn more about Binding

Performance at a Glance

Data Binding1.21×vs. direct Jackson 2 · 100KB Users POJO read
GraalVM Native Image1.35×vs. direct Jackson 2 · 100KB Users POJO read
JSONPath Navigation54.11×vs. SJF4J Runtime · direct POJO lookup, 100KB
JSON Schema Validation53.6×vs. SJF4J Runtime · Creek POJO validation
Object Mapping1.31×vs. MapStruct · extended Order, 100KB
JDBC Result Mapping16.03×vs. Spring JDBC · 1,000 POJO rows

Selected, workload-specific speedups, not a cross-category ranking. The comparison baseline is different in each case; see the charts and linked reports for details.

Explore Benchmarks

Use SJF4J with Spring

Use compiled SJF4J APIs as Spring-managed beans — no manual instantiation or component annotations required.

Define InterfaceJava
@CompiledMapper
public interface UserMapper {
    UserDto toDto(User user);
}
Use in SpringJava
@Service
public class UserService {
    @Autowired
    private UserMapper mapper;

    public UserDto convert(User user) {
        return mapper.toDto(user);
    }
}

Automatic bean registration Compile-time generated implementations Standard Spring dependency injection

Spring Integration

Released under the MIT License.