-
Notifications
You must be signed in to change notification settings - Fork 0
CodeAPI 4
This page describes the changes of CodeAPI 4. I'm writting this because CodeAPI 4 will receive a lot of features during its development, there is no release date and the CodeAPI 4 will grow as needed. Snapshots of CodeAPI 4 may be stable and backward compatible, but compatibility is not guaranted.
- Builder, the change probably breaks codes written to CodeAPI 3.
We will periodically release nightlies
and snapshots
.
-
Nightlies: Unstable builds. This is not recommended to be used in production, nightly features are subject to change (and probably will be changed in the next
nightly
orsnapshot
) -
Snapshots: Subject to be stable, and probably have more standardized features. We do not guarantee that these features will not change before the release.
Now Builder classes are not automatically generated.
Yeah, finally anonymous classes.
We will change the way you create dynamic invocations. (at this moment this is only what I can say).
This is described in #54 and #55.
You do not need to wrap all Class
instances into a CodeType
using CodeAPI.getJavaType
(which only exists for historical reasons) or CodeTypes.getCodeType
. All Type
will be converted to a CodeType
internally.
We also introduced isAssignableFrom
, getSuperclass
, getInterfaces
and a CodeTypeResolver
which can resolve a CodeType
to any type (Mainly to a Class
or a TypeElement
, but can be used to translate to any type). Obs: isAssignableFrom
, getSuperclass
and getInterfaces
depends on the CodeTypeResolver
.
I'm not sure how this will be, but this will add validation of CodeAPI structures, some validations will be added directly to init
of the CodePart
others validations will be made by a class
(extensible). See issue #47
More changes on generator, I do not like the way that the generators works, I want a better code, with a better performance.
All generators will be visitor-like and will have overloaded methods for each CodeAPI base types. (We will not remove ability to register custom types, but it will be made in a different way).
I'm always looking for performance improvements, but I don't like premature optimizations, then I need to profile the code and analyze it strictly to find which parts need improvements (I think that Java itself need improvements).
If you are migrating from 3.0, you will need to change some codes to reference to new builder classes.
More info later