Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

The source for this example is the "custom-injection" directory located in the openejb-examples.zip available on the download page.

The Code

Bean Class

...

The META-INF/env-entries.properties file

...

...

The Custom Type and Editor

Support for java.lang.Enum types is already built-in, but we've decided we'd like to allow abbreviated versions of the enum constants to be usable. We do this by creating a custom PropertyEditor for our Pickup enum like so:

...

...

We cleverly install this PropertyEditor in a static block in the Pickup class that will be executed should someone actually reference the Pickup type.

...

...

Test Case

...

...

Running it

Running the example is fairly simple. In the "custom-injection" directory of the examples zip, just run:

...

Which should create output like the following.

...

...