Skip to content

A simple annotation-driven library for modifying Java code at runtime

License

Notifications You must be signed in to change notification settings

wordandahalf/Blueprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blueprint Logo

CodeFactor


Blueprint is a simple, annotation-driven library for modifying Java code at runtime

Usage

Currently, Blueprint is not hosted on any Maven repositories, so you must download the source and manually compile it. This README will be updated to reflect whether or not that changes.

To include it as a dependency, either directly add the JAR or add the following dependecy to your POM.

<dependency>
    <groupId>io.github.wordandahalf</groupId>
    <artifactId>Blueprint</artifactId>
    <version>0.1.0</version>
</dependency>

Here is a simple example of how to utilize Blueprint:

package blueprintTest;

public class Foo {
    private String text;
    
    public Foo() { this.text = "Hello, foo!"; }
    
    public void getFoo() { System.out.println(this.text); }
}
package blueprintTest;

@Blueprint(target = "blueprintTest.Foo")
public class BlueprintTest {
    public static void main(String[] args) throws Exception {
        Blueprints.add(BlueprintTest.class);
        Blueprints.apply();
        
        Foo foo = new Foo();
        foo.getFoo();
    }
    
    @Inject(target = "getFoo", at = @At(location = At.Location.TAIL))
    public void getFoo() {
        System.out.println("Hello, world!");
    }
}

When ran, this program will have the output:

Hello, foo!
Hello, world!

For more extensive documentation and examples, please see the Wiki

About

A simple annotation-driven library for modifying Java code at runtime

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages