Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Plugin framework based on Netbeans Lookup api
Java Groovy
Pull request Compare This branch is 4 commits ahead, 2 commits behind master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
joint-core
joint-nav-spi
joint-nav
joint-registers-spi
joint-registers
test
tooling
wicket-joint
.gitignore
README.md
pom.xml

README.md

About

Joint is a plugin/module framework based on the Netbeans Lookup api.

Currently focus is on providing a plugin framework for Wicket.

There is an example Wicket application in the sources that discovers wicket pages in a specific navigation context and creates links for them.

The example project can be found at https://svn.kenai.com/svn/joint~svn/branches/dev/wicket-joint/wicket-joint-example

Basics

  • org.joint.JointLookup - Utility class for working with the Netbeans Lookup api
  • org.joint.annotations.Joint - Assigns an ID that can be used to lookup an instance of a Jointed class and/or instantiate it.
  • org.joint.tooling.annotations.Export - Accepts an array of Classes (extending Jointed). During compile time entries in META-INF/services will be created so the Netbeans Lookup api can find these implementations. ''(you could do this manually if your sources aren't set to 1.6)''

So the most basic example would looks something like

@Joint(id = "A1")
@Export({Jointed.class})
public class MyClass implements SomeInterface {
    ....
}

And you would be able to access it in the following ways

/* get a list of all implementations of Jointed.class */
Set<? extends Jointed> classes = JointLookup.lookupJoints(SomeInterface.class);

/* find a specific implementation by type */
Class<? extends Jointed> clazz = JointLookup.getJoint(SomeInterface.class);

/* find a specific implementation by id & type */
Class<? extends Jointed> clazz = JointLookup.findByJointId(SomeInterface.class, "A1");

/* And you can create a new instances as well */
Jointed instance = JointLookup.newJointInstance(SomeInterface.class, "A1");
MyClass instance = JointLookup.newJointInstance(MyClass.class);

Links

Something went wrong with that request. Please try again.