org.jvnet.hk2.annotations
Annotation Type Contract


@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE,ANNOTATION_TYPE})
public @interface Contract

Marker annotation to allow implementations to be discovered from the contract they implement.

There are two usages of this annotation.

Contract interface

This annotation can be placed on interfaces and abstract classes T, and derived classes that are assignable to T with Service annotation can be looked up by using Habitat#getByContract(Class) (and its family of methods.)

Contract annotation

This annotation can be used as a meta-annotation on another annotation (let's say X), along with Index annotation on one of its property. What happens in this case is that when X is placed on classes, those classes will be marked as implementations of the contract.

See Also:
Index



Submit a bug or feature

Copyright © 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.

Generated on 12-March-2010 04:35