com.sun.enterprise.tools.apt
Class ServiceAnnotationProcessor

java.lang.Object
  extended by com.sun.enterprise.tools.apt.ServiceAnnotationProcessor
All Implemented Interfaces:
com.sun.mirror.apt.AnnotationProcessor, com.sun.mirror.apt.AnnotationProcessorListener, com.sun.mirror.apt.RoundCompleteListener, EventListener

public class ServiceAnnotationProcessor
extends Object
implements com.sun.mirror.apt.AnnotationProcessor, com.sun.mirror.apt.RoundCompleteListener

This class is proccessing the @Service annotation and generates META-INF/services style text file for each interface annotated with @Contract

Author:
Jerome Dochez

Constructor Summary
ServiceAnnotationProcessor(com.sun.mirror.apt.AnnotationProcessorEnvironment env)
          Creates a new instance of ServiceAnnotationProcessor
 
Method Summary
protected  void loadExistingMetaInfFiles()
          Loads all existing META-INF/services file from our destination directory This is usuful because during incremental builds, not all source files are recompiled, henve we cannot rewrite the META-INF/services file from scratch each time, but append/remove entries from it as necessary.
 void process()
          Annotation processor entry point, we are using a visitor pattern the visit only the class declaration.
 void roundComplete(com.sun.mirror.apt.RoundCompleteEvent e)
          Notification of round complete, I use this to actually write the service file content and close the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceAnnotationProcessor

public ServiceAnnotationProcessor(com.sun.mirror.apt.AnnotationProcessorEnvironment env)
Creates a new instance of ServiceAnnotationProcessor

Method Detail

loadExistingMetaInfFiles

protected void loadExistingMetaInfFiles()
Loads all existing META-INF/services file from our destination directory This is usuful because during incremental builds, not all source files are recompiled, henve we cannot rewrite the META-INF/services file from scratch each time, but append/remove entries from it as necessary.


process

public void process()
Annotation processor entry point, we are using a visitor pattern the visit only the class declaration.

Specified by:
process in interface com.sun.mirror.apt.AnnotationProcessor

roundComplete

public void roundComplete(com.sun.mirror.apt.RoundCompleteEvent e)
Notification of round complete, I use this to actually write the service file content and close the file.

Specified by:
roundComplete in interface com.sun.mirror.apt.RoundCompleteListener
Parameters:
e -


Copyright © 2013 Oracle Corporation. All Rights Reserved.