42lines / metagen Goto Github PK
View Code? Open in Web Editor NEWAnnotation processor for generating compile-time safe property expressions
License: Apache License 2.0
Annotation processor for generating compile-time safe property expressions
License: Apache License 2.0
If we have
public class Foo { @Property int bar; }
and
public class FooSubclass extends Foo { @Property int baz; }
then FooSubclassMeta
should extend FooMeta
and inherit bar
Propagate @deprecated annotations from source to generated code.
It gives NullPointerException on generation due to TypeResolver.visitWildcard where you rely on super type definition:
@Override
public String visitWildcard(WildcardType t, Void p)
{
if (t.getSuperBound() != null)
{
return " ? super " + t.getSuperBound().accept(this, null);
}
else
{
return " ? extends " + t.getExtendsBound().accept(this, null);
}
}
But the class could be defined without bound definition just with "?". I added that to your code and everything is fine.
@Override
public String visitWildcard(WildcardType t, Void p)
{
if (t.getSuperBound() != null)
{
return " ? super " + t.getSuperBound().accept(this, null);
}
else if (t.getExtendsBound() != null)
{
return " ? extends " + t.getExtendsBound().accept(this, null);
} else {
return " ?";
}
}
Currently if we have class B extends A and we use metagen inside an IDE to make changes to B the generated BMeta will not extend AMeta because A is not passed to the processor by the IDE. this works fine on command line because all the source files in the project are processed together, but this is not the case inside IDEs.
if a property is inside a private inner class it will not be visible to anyone, eg
public class Foo {
private static class Bar {
@Property int baz;
}
}
Then BarMeta
has to contain a reference to Foo.Bar.baz
which it cannot because Bar
is private.
When this happens we should either ERROR or WARN if @Property
is used and not generate the binding if @Bean
or a like general class annotation is used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.