Git Product home page Git Product logo

beans-graph's People

Contributors

headstar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

beans-graph's Issues

Bean class is not public

I'm happy to find this project because it will help for my use case and I'm thankful for that project.

I launch the base code at it prints correctly all the dependencies of my application :

import com.headstartech.beansgraph.BeansGraphProducer;
import com.headstartech.beansgraph.ConsoleReporter;
import com.headstartech.beansgraph.EnableBeansGraph;
import org.springframework.stereotype.Component;

@EnableBeansGraph
@Component
public class ConfigureBeanGraphReporters implements BeansGraphConfigurer {

    @Override
    public void configureReporters(BeansGraphProducer producer) {
        ConsoleReporter.forSource(producer).build();
    }
}

However, i want to have my own Reporter, therefore I create a class that implements BeansGraphListener and I want to implement my logic in onBeanGraphResult:

public class BeanGraphChecker implements BeansGraphListener {
    @Override
    public void onBeanGraphResult(ApplicationContext applicationContext, BeansGraphResult result) {
        checkBeanDependencies(applicationContext, result);
    }

    private void checkBeanDependencies(ApplicationContext applicationContext, BeansGraphResult result) {
        UnmodifiableDirectedGraph<Bean, DefaultEdge> graph =  result.getDependencyGraph();
        // Implement my logic on the graph here
    }
}

However, that code does not compile because the Bean class is package protected and not public.
I tried to hack by moving the class to the com.headstartech.beansgraph; package, but I get a runtime error this time.

How am I suppose to use/extend the library when I cannot accessing the Bean class ?

I could fork the project to change the source code but currently I only need that little change.

The Bean class was public and was changed to package since commit d72147, what was the reason to change the visibility at the time ?

Thanks for reading my problem :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.