modules/annotation-processor/src/main/java/org/ballerinalang/natives/annotation/processor/BallerinaAnnotationProcessor.java
@Override
    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
        Set<Element> balFunctionElements = (Set<Element>) roundEnv.getElementsAnnotatedWith(BallerinaFunction.class);
        Set<Element> balConnectorElements = (Set<Element>) roundEnv.getElementsAnnotatedWith(BallerinaConnector.class);
        Set<Element> balActionElements = (Set<Element>) roundEnv.getElementsAnnotatedWith(BallerinaAction.class);
        Set<Element> balTypeMapperElements =
                (Set<Element>) roundEnv.getElementsAnnotatedWith(BallerinaTypeMapper.class);
        
        // If all annotations are empty, should not do anything. Continue to the next plugin phases.
        if (balFunctionElements.isEmpty() && balConnectorElements.isEmpty() && balActionElements.isEmpty()
                    && balTypeMapperElements.isEmpty()) {
            return true;
        }
        
        // Process all native function, connectors, actions and type converters
        processNativeFunctions(balFunctionElements);
        processNativeConnectors(balConnectorElements);
        processNativeActions(balActionElements);
        processNativeTypeMappers(balTypeMapperElements);
        
        Map<String, String> options = processingEnv.getOptions();
        
        String srcDir = options.get(SOURCE_DIR);
        if (srcDir == null) {
            throw new BallerinaException("source directory of ballerina files must be specified.");
        }
        
        // Generate the native ballerina files
        generateNativeBalFiles(options, srcDir);
        
        // Generate the construct provider class. This should be invoked after 
        // generating the native ballerina files
        generateConstructProviderClass(options, srcDir);
        
        return true;
    }
/**
     * Process the ballerina annotations and generate the construct provider class.
     *
     * {@inheritDoc}
     */
Process the ballerina annotations and generate the construct provider class.
Process the ballerina annotations and generate the construct provider class .
@Override
    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
        Set<Element> balFunctionElements = (Set<Element>) roundEnv.getElementsAnnotatedWith(BallerinaFunction.class);
        Set<Element> balConnectorElements = (Set<Element>) roundEnv.getElementsAnnotatedWith(BallerinaConnector.class);
        Set<Element> balActionElements = (Set<Element>) roundEnv.getElementsAnnotatedWith(BallerinaAction.class);
        Set<Element> balTypeMapperElements =
                (Set<Element>) roundEnv.getElementsAnnotatedWith(BallerinaTypeMapper.class);
        if (balFunctionElements.isEmpty() && balConnectorElements.isEmpty() && balActionElements.isEmpty()
                    && balTypeMapperElements.isEmpty()) {
            return true;
        }
        processNativeFunctions(balFunctionElements);
        processNativeConnectors(balConnectorElements);
        processNativeActions(balActionElements);
        processNativeTypeMappers(balTypeMapperElements);
        Map<String, String> options = processingEnv.getOptions();
        String srcDir = options.get(SOURCE_DIR);
        if (srcDir == null) {
            throw new BallerinaException("source directory of ballerina files must be specified.");
        }
        generateNativeBalFiles(options, srcDir);
        generateConstructProviderClass(options, srcDir);
        return true;
    }
@ Override public boolean process ( Set < ? extends TypeElement > annotations , RoundEnvironment roundEnv ) { Set < Element > balFunctionElements = ( Set < Element > ) roundEnv . getElementsAnnotatedWith ( BallerinaFunction . class ) ; Set < Element > balConnectorElements = ( Set < Element > ) roundEnv . getElementsAnnotatedWith ( BallerinaConnector . class ) ; Set < Element > balActionElements = ( Set < Element > ) roundEnv . getElementsAnnotatedWith ( BallerinaAction . class ) ; Set < Element > balTypeMapperElements = ( Set < Element > ) roundEnv . getElementsAnnotatedWith ( BallerinaTypeMapper . class ) ; if ( balFunctionElements . isEmpty ( ) && balConnectorElements . isEmpty ( ) && balActionElements . isEmpty ( ) && balTypeMapperElements . isEmpty ( ) ) { return true ; } processNativeFunctions ( balFunctionElements ) ; processNativeConnectors ( balConnectorElements ) ; processNativeActions ( balActionElements ) ; processNativeTypeMappers ( balTypeMapperElements ) ; Map < String , String > options = processingEnv . getOptions ( ) ; String srcDir = options . get ( SOURCE_DIR ) ; if ( srcDir == null ) { throw new BallerinaException ( "source directory of ballerina files must be specified." ) ; } generateNativeBalFiles ( options , srcDir ) ; generateConstructProviderClass ( options , srcDir ) ; return true ; }
Process the ballerina annotations and generate the construct provider class.
Process the ballerina annotations and generate the construct provider class .
// If all annotations are empty, should not do anything. Continue to the next plugin phases. // Process all native function, connectors, actions and type converters // Generate the native ballerina files // Generate the construct provider class. This should be invoked after  // generating the native ballerina files