Behaim

Behaim framework for exploring a Java object graph via reflection. Supports visitor-based modification of the object graph.

License

License

GroupId

GroupId

com.github.chrisgleissner
ArtifactId

ArtifactId

behaim
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Behaim
Behaim framework for exploring a Java object graph via reflection. Supports visitor-based modification of the object graph.
Project URL

Project URL

https://github.com/chrisgleissner/behaim/
Project Organization

Project Organization

none
Source Code Management

Source Code Management

https://github.com/chrisgleissner/behaim

Download behaim

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.chrisgleissner/behaim/ -->
<dependency>
    <groupId>com.github.chrisgleissner</groupId>
    <artifactId>behaim</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.chrisgleissner/behaim/
implementation 'com.github.chrisgleissner:behaim:0.2.0'
// https://jarcasting.com/artifacts/com.github.chrisgleissner/behaim/
implementation ("com.github.chrisgleissner:behaim:0.2.0")
'com.github.chrisgleissner:behaim:jar:0.2.0'
<dependency org="com.github.chrisgleissner" name="behaim" rev="0.2.0">
  <artifact name="behaim" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.chrisgleissner', module='behaim', version='0.2.0')
)
libraryDependencies += "com.github.chrisgleissner" % "behaim" % "0.2.0"
[com.github.chrisgleissner/behaim "0.2.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.6.0
ch.qos.logback : logback-classic Optional jar 0.9.21

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.assertj : assertj-core jar 1.7.1
org.mockito : mockito-core jar 1.10.19

Project Modules

There are no modules declared in this project.

Behaim

Maven Central Javadocs Build Status Coverage Status Maintainability

Behaim uses Java reflection to explore an domain model up to a configurable recursion depth. The resulting meta data can then be used by pluggable visitors.

As a proof of concept, Behaim currently comes with a builder visitor that allows for the creation of randomly populated object graphs which may be useful for performance tests.

Features

  • Multi-threaded graph exploration
  • Re-use of meta data about an already explored object graph
  • Extensible with custom visitors. Already comes with a visitor to create a randomly populated object graph.

Builder Usage

Default configuration

Foo foo = Builder.make(Foo.class);
Collection<Foo> foos = Builder.make(Foo.class, 100);

Custom configuration

Config config = new Config(...);
Foo foo = Builder.make(Foo.class, config);
Collection<Foo> foos = Builder.make(Foo.class, config, 100);

Repeated builds When you need to repeatedly create objects with the same configuration, use the instance make method.

Builder builder = new Builder(Foo.class);
Collection<Foo> foos1 = builder.make(100);
Collection<Foo> foos2 = builder.make(50);

FAQ

What does Behaim mean? Martin Behaim (1459 – 1507) was a German cosmographer, astronomer, geographer and explorer. His Erdapfel from 1492 is considered to be the oldest surviving terrestrial globe.

Versions

Version
0.2.0
0.1.0