A heavily extended fork of the com.sun.codemodel (from 2013/09)
OTHER License
A fork of the com.sun.codemodel 2.7-SNAPSHOT.
The classes in this project use a different package name com.helger.jcodemodel
to avoid conflicts
with other com.sun.codemodel
instances that might be floating around in the classpath.
That of course implies, that this artefact cannot directly be used with JAXB, since the configuration of
this would be very tricky.
A site with the links to the API docs etc. is available.
Add the following to your pom.xml to use this artifact:
<dependency>
<groupId>com.helger</groupId>
<artifactId>jcodemodel</artifactId>
<version>3.4.0</version>
</dependency>
ph-commons
as a dependency for common stuffexceptions
packageJResourceDir
to represent pure resource directories (issue #74 from @guiguilechat)JCodeModelException
as the base class for JClassAlreadyExistsException
and the new class JResourceAlreadyExistsException
JCodeModelException
instead of JClassAlreadyExistsException
JCNameUtilities.getFullName
works with classes in the default packageJCodeModel
with (get|set)FileSystemConvention
to make the creation more flexible (also issue #74 from @guiguilechat)JavaUnicodeEscapeWriter
publicly accessibleJTryBlock
API to have more control.try-with-resources
support (issue #67 from @gmcfall)jsr305
instead of annotations
in POM (issue #66 from @jjYBdx4IL)var
as reserved wordJReturn
constructor publicJInvocation._this
static methodIJExpression.castTo
methodfinal
variables in for each
loopsJExpr.dotClass
now takes AbstractJType
and not just AbstractJClass
IJStatement
publicJCMWriter
that should be used to emit the outgoing Java files. This replaces codemodel.build
and offers a more consistent API. Most existing method remain existing and deprecated and just forward to JCMWriter
.
cm.build (...)
use new JCMWriter (cm).build (...)
IJFormatter
interface for better separation of concerns. JFormatter
was moved to a sub-packageProgressCodeWriter
no longer needs an explicit PrintStream
but a ProgressCodeWriter.IProgressTracker
instead.UTF-8
.JAnnotationUse
method overloads that automatically pass value
as the annotation parameter name (issue #64) AbstractJType._new()
JBlock
methods to void
to avoid chaining (issue #62) - incompatible change!JExpr.invokeThis
and JExpr.invokeSuper
static methodsJInvocation.arg...
sanity methodsHashMap<>
)strictfp
keyword.T extends AnyClass & Serializable
)Pull requests must follow my personal Coding Styleguide
This project uses double-space for indentation. If you want to use tabs, you can ask git to modify the files when commiting them and when pulling them. For this, from your project directory :
*.java filter=tabspace
. This will tell git to apply the script tabspace on the *.java filesgit config filter.tabspace.clean 'expand --tabs=2 --initial'
to ask git to replace tabs with two spaces on commit of *.java files.git config filter.tabspace.smudge 'unexpand --tabs=2 --first-only'
to request git to replace double spaces with two tabs on checking a *.java file out.For eclipse, a formatter xml and a cleanup xml are present in the meta/formatter/eclipse/ directory. You can load them from the "project properties > java code style" settings. Check "Enable project specific settings", then load them.
NOTE : you also need to change the save actions to make them meet the clean up actions. Save actions are done even when they are not present in the clean up.
On Twitter: @philiphelger | Kindly supported by YourKit Java Profiler