This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Add new FreeMarker attributes to support java source-level sensitive templates | ||
---|---|---|---|
Product: | java | Reporter: | pslechta <pslechta> |
Component: | Source | Assignee: | pslechta <pslechta> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | apireviews |
Priority: | P3 | Keywords: | API, API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Diff -- proposed changes
Diff -- code changes based on advices from JG |
Description
pslechta
2008-06-24 13:16:22 UTC
Created attachment 63331 [details]
Diff -- proposed changes
Also one note on new attribute names javaSourceLevel and java15style: (1) The intention was to make usage of these attributes in templates as simple as possible. This is the reason why attributes are not more "structured" (like "project.javac.source" instead of "javaSourceLevel"). Proper usage of simple attributes is less complicated than usage of "structured" ones: <#if javaSourceLavel?? && javaSourceLavel != "1.5"> is simpler than <#if project?? && project.javac?? && project.javac.source?? && project.javac.source!= "1.5"> (2) Attribute "java15style" is defined only if Java source-level is 1.5 or later. So it can be used very easily to add for example annotations into the code: <#if java15style??> @Override </#if> (3) New attributes cannot be under "project" collection because this collection is provided by another attribute provider so it would be overridden. [JG01] JavaTemplateAttributesProvider should likely be in java.project; wherever it is, the attributes it provides should be documented in the module's Javadoc (e.g. overview.html). [JG02] org.openide.modules.SpecificationVersion may be useful for implementing isJava15orLater. Re [JG01]: new attributes are now documented in arch.xml Re [JG02]: SpecificationVersion class is used now (instead of regexp) Please see new attachment. Created attachment 63763 [details]
Diff -- code changes based on advices from JG
This is last call before this change will be incorporated into trunk! If anyone has any objections, please state them now! |