Coder Social home page Coder Social logo

bindgen's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bindgen's Issues

@Override

@OverRide should be put on "setWithRoot" and "set" methods by generator when generating inner binding classes(My*Binder) which extend *BindingPath in order to eliminate compilation warnings.

Bindings for selected fields only

Hi,
Im very interested in using bindgen in my project but I have one problem.

Now when I annotate my class with @bindable Bindgen generates binding for all fields, methods etc.
I would like to limit this to only few fields. I know that I can do this with "scope" or "skip attribute" in binding.properties but this solution has two issues:

1)its hard to "synchronize" class source file with this file. Every time I add field or method to the class which should not be bindable I have to modify binding.properties file. With a lot of bindable classes binding.properties could be quite large and messy.
2)attribute names in binding.properties are strings, when your refactor your code (move or change attribute name) you have to change binding.properties file as well. As I understand purpose of Bindgen it was created to not put attribute/method names in strings.

I have an idea how to limit bindings without using binding.properties file.

First I propose to add "scope"attribute to Bindable anotation. It could have values: ALL, FIELDS, METHODS, NONE...
Default value could be ALL

So @bindable is equivalent to @bindable(scope=ALL) - backward comability

@bindable(scope=FIELDS) generates bindings just for fields, METHOS for methods etc.
If you would like to generate bindings just for few (from many) fields you could use:

@bindable(scope=NONE)

and put @bindable (or simillar) annotation next to field:

@bindable int age;

For me(and probably not only for me) @bindable(scope=NONE) is prefered way of work, so it would be nice to add to binding.properties setting like "defaultScope" - when you add to the binding.properties something like:
defaultScope=NONE
than
@binding is equivalent to @binding(scope=NONE).

@binding (scope=NONE) has adventage because it allows you to fully control behaviour of framework - you could select (by annotating them with @bindable or similar) fields or methos which should be annotated.

It is only an idea, implementation details could vary, for example it could also looks like this:
@bindable(fields=true, methods=true)

Going futher it would be nice to have more control over field/method selection, for example:
@bindable(fields=PROTECTED, methods=PUBLIC)

Going more further it would be nice to have AspectJ(or regexp) like expressions:

@bindable(fields="public int " methods=" int bindbale_(_)")
this means:
genrate bindings for all public int fields
and generate bindings for all methods returning int where method name starts with bindable

Im very interested in Bindgen, so If you need any help in extending this framework I could help.

Regards Daniel

suid for generated serializable classes

You should consider adding an option to include automatically generated suid in your binding classes or some user defined suid.

Reason:
The company i work for has a global warning policy that threats missing suid in serializable class as a warning, and we have a requirement that the project has to have 0 warnings.

This prevents us from using the library although we are quite eager to do so.

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.