Author: alexsmirnov
Date: 2009-11-10 20:29:38 -0500 (Tue, 10 Nov 2009)
New Revision: 15862
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
Log:
Switch to new template parser.
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2009-11-11
01:28:26 UTC (rev 15861)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2009-11-11
01:29:38 UTC (rev 15862)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.templatecompiler;
import java.io.File;
@@ -43,16 +41,16 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class RendererClassGenerator implements CdkWriter {
private CdkContext context;
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.cdk.CdkWriter#init(org.richfaces.cdk.CdkContext)
*/
@Override
@@ -62,7 +60,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see
* org.richfaces.cdk.CdkWriter#render(org.richfaces.cdk.model.ComponentLibrary
* )
@@ -72,20 +70,27 @@
for (RenderKit renderKit : library.getRenderKits()) {
for (Renderer renderer : renderKit.getRenderers()) {
Template template = renderer.getTemplate();
- // TODO - put real parameters.
- RendererClassVisitor visitor = new
RendererClassVisitor(template.getInterface());
- template.getImplementation().visit(visitor);
- JavaClass javaClass = visitor.getRendererClass();
- String fullName = javaClass.getFullName();
- File outFile =
context.createOutputFile(StandardOutputs.RENDERER_CLASSES,
- fullName.replace('.', '/') +
".java", library.lastModified());
+ if (null != template) {
+ // TODO - put real parameters.
+ RendererClassVisitor visitor = new RendererClassVisitor(
+ template.getInterface());
+ template.getImplementation().visit(visitor);
+ JavaClass javaClass = visitor.getRendererClass();
+ String fullName = javaClass.getFullName();
+ File outFile = context.createOutputFile(
+ StandardOutputs.RENDERER_CLASSES, fullName.replace(
+ '.', '/')
+ + ".java", library.lastModified());
- if (null != outFile) {
- try {
- new JavaClassRenderer().render(javaClass, new
PrintWriter(outFile));
- } catch (FileNotFoundException e) {
- throw new CdkException(e);
+ if (null != outFile) {
+ try {
+ new JavaClassRenderer().render(javaClass,
+ new PrintWriter(outFile));
+ } catch (FileNotFoundException e) {
+ throw new CdkException(e);
+ }
}
+
}
}
}
Show replies by date