com.fluxtion.builder.annotation.ClassProcessor Maven / Gradle / Ivy
/*
* Copyright (C) 2019 V12 Technology Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Server Side License for more details.
*
* You should have received a copy of the Server Side Public License
* along with this program. If not, see
* .
*/
package com.fluxtion.builder.annotation;
import java.io.File;
import java.net.URL;
import java.util.ServiceLoader;
/**
* A ClassProcessor service can inspect and process application classes after
* they are compiled. The callback {@link #process(java.net.URL) } points to the
* compiled application classes. No external libraries are on the process URL,
* solely the output of compiling application source files.
*
* This gives the opportunity for {@link ClassProcessor}'s to scan the path and
* generate artifacts without risk of confusing library and application classes.
* For example a service may scan for a specific annotation and generate a
* tailored solution based on the meta-data discovered during scanning.
*
*
Registering ClassProcessor
* Fluxtion employs the {@link ServiceLoader} pattern to register user
* implemented NodeFactories. Please read the java documentation describing the
* meta-data a factory implementor must provide to register a factory using the
* {@link ServiceLoader} pattern.
*
* @author V12 Technology Ltd.
*/
public interface ClassProcessor {
/**
* Directories for the current generation context
*
* @param rootDir - root directory of the project
* @param output - directory for generated source outputs
* @param resourceDir - directory for generated resource outputs
*/
default void outputDirectories(File rootDir, File output, File resourceDir) {
}
/**
* The URL of compiled application classes
*
* @param classPath application classes location
*/
void process(URL classPath);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy