Skip to content
Lightweight dependency management for Java apps.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings
src
.classpath
.gitignore
.project
.travis.yml
Jenkinsfile
README.md
pom.xml

README.md

Build Status

delight-factories

A simple API for factories based on simple plain Java objects.

Part of Java Delight.

Usage

Create a collection of factories:

FactoryCollection factories = Factories.create();

Define classes for a factory:

private static class MyConfiguration implements Configuration {}
	
private static class MyDependencies implements Dependencies {}

Register a factory:

factories.register(new Factory<String, MyConfiguration, Dependencies>() {

	@Override
	public boolean canInstantiate(Configuration conf) {
		return (conf instanceof MyConfiguration);
	}

	@Override
	public String create(MyConfiguration conf, Dependencies dependencies) {
		
		return "Hello, World!";
	}
	
});

Instantiate an object:

Object created = factories.create(new MyConfiguration(), new MyDependencies());
// created == "Hello, WorlD!";

Maven Dependency

<dependency>
    <groupId>org.javadelight</groupId>
    <artifactId>delight-factories</artifactId>
    <version>[insert latest version]</version>
</dependency>

This artifact is available on Maven Central and BinTray.

Maven Central

Links

-> All Project Reports

You can’t perform that action at this time.