Giter Club home page Giter Club logo

metagen's People

Contributors

cpopetz avatar david-hosier avatar ivaynberg avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metagen's Issues

Add support for subclasses

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

Unable to process metamodel for SomeClass<?>

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 " ?";
        }
    }

Support partial compilation inside IDEs

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.

Prefer @Property on @Entity metamodel generation

Having a non-standard getter (i.e. one that returns the field wrapped in an Optional) leads to the ClassNameMeta having a wrapper-typed metamodel field. Adding a @Property annotation doesn't help - perhaps the code can be tweaked to prefer the @Property annotation over the getter, when available.

Warn on private inner classes

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.

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.