Git Product home page Git Product logo

jcodemodel's Introduction

#JCodeModel (v1.0.3)

JCodeModel is a fork of the existing Sun codemodel, part of the GlassFish project. With java.net in ruins, it seemed liked a good time to fork this project and clean it up as well as add some new features (for example, Java 7 syntax).

The current release is 1.0.3, and contains several fixes, cosmetic improvements to the output, and some improved functionality for inner classes to support the development of Flapi.

Many thanks to the original contributors, namely @Kohsuke.

Usage

The dependencies are deployed to Maven Central. To use, add the following to your build script:

Maven

<dependency>
  <groupId>com.unquietcode.tools.jcodemodel</groupId>
  <artifactId>codemodel</artifactId>
  <version>1.0.3</version>
</dependency>

Gradle

dependencies {
  compile 'com.unquietcode.tools.jcodemodel:codemodel:1.0.3'
}

jcodemodel's People

Contributors

johncarl81 avatar unquietcode avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jcodemodel's Issues

publish to maven central

Would it be possible to upload JCodeModel to the main maven repository ? It's safer for projects that depends on JCodeModel

importing generic class

My code is using a 2.5-SNAPSHOT of the original code, after upgrading to the 2.5 or your fork, the generated code differs when importing generics:

2.5-SNAPSHOT => OK
import com.stateforge.statemachine.context.AbstractContext;

2.5 or UnquietCode/JCodeModel 2.7 => KO
import com.stateforge.statemachine.context.AbstractContext<PingPingState, PingContext>;

Here is the interesting diff:

diff -ru CodeModel/codemodel/src/main/java/com/sun/codemodel/JFormatter.java ../../JCodeModel/codemodel/src/main/java/com/sun/codemodel/JFormatter.java
--- CodeModel/codemodel/src/main/java/com/sun/codemodel/JFormatter.java 2015-02-02 00:21:56.000000000 +0000
+++ ../../JCodeModel/codemodel/src/main/java/com/sun/codemodel/JFormatter.java  2015-03-23 23:30:23.000000000 +0000

@@ -442,12 +443,7 @@
                     clazz = clazz.erasure();
                 }

-                String fullName = clazz.fullName();
-                int indexOfLt = fullName.indexOf('<');
-                if(indexOfLt > 1){
-                   fullName = fullName.substring(0, indexOfLt);
-                }
-                p("import").p(fullName).p(';').nl();
+                p("import").p(clazz.fullName()).p(';').nl();
             }

Any opinion on that issue ? Would you accept a PR with the change and release a new version or should I continue using my local version ?

Support for jdk 8 default methods

Interfaces can have default methods now in JDK 8. I cannot define them in JCodeModel because 'default' isn't a thing as a modifier or otherwise in JDefinedClass or JMethod.

Support bounded types in generics.

Looks like it was never finished. Wildcards do seem to be supported in a limited case. I don't think it's possible to instantiate wildcard though.

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.