Search |
||
List of annotations in Annotation Processor FactoryPosted by arungupta on September 1, 2005 at 4:15 PM PDT
The annotation processor in JAX-WS
2.0 has been using wildcards to specify the list of annotations that can be
processed. For example, the list of supported annotations was initialized as:
static {
Collection<String> types = new HashSet<String>();
types.add("javax.jws.*");
types.add("javax.jws.soap.*");
types.add("javax.xml.ws.*");
supportedAnnotations = Collections.unmodifiableCollection(types);
}
This is an easy and convenient way to capture all the annotations supported by JSR 224. This way of specifying the list of annotations is good if JAX-WS exist by
itself. But JAX-WS is the API for XML Web Services in the Java platform and is
expected to be composed with other Web Services specifications in the future.
It's also likely that packages for such Web Services specifications will be
defined as a sub-package of Relying upon static {
Collection<String> types = new HashSet<String>();
types.add("javax.jws.HandlerChain");
types.add("javax.jws.Oneway");
types.add("javax.jws.WebMethod");
...
supportedAnnotations = Collections.unmodifiableCollection(types);
}
Similarly, JAX-WSA annotation processor will need to define the list of
supported annotations using fully qualified name. This will ensure that even if JAX-WSA annotations are defined in Thus, I learned that it's a good practice to specify fully qualified annotations in the list supported by your annotation processor factory. Technorati: annotation Programming »
Related Topics >>
Java Web Services and XML Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|