Download Sources

com.liguorien.flex.generator.handlers
Class FlexModelBuilderHandler

java.lang.Object
  extended by com.liguorien.flex.generator.handlers.AbstractGeneratorHandler<FlexModelBuilderHandler>
      extended by com.liguorien.flex.generator.handlers.FlexModelBuilderHandler
All Implemented Interfaces:
FlexGeneratorHandler

public class FlexModelBuilderHandler
extends AbstractGeneratorHandler<FlexModelBuilderHandler>

Generates code which will read and create XML from ActionScript objects.

Version:
0.2
Author:
Nicolas Désy

Constructor Summary
FlexModelBuilderHandler()
           
FlexModelBuilderHandler(java.lang.String builderSuffix)
          Creates a new instance of FlexModelBuilderHandler
 
Method Summary
protected  void appendClassSuffix(java.lang.StringBuilder buffer)
          Appends a suffix to name of the generated class.
protected  void appendExtension(java.lang.StringBuilder buffer)
          Appends the extension of the generated file.
 java.lang.String getBuilderSuffix()
           
 ClassType getClassType()
          Get the ClassType for this handler.
 ClassWriter getClassWriter()
          Get the ClassWriter of this handler.
 java.io.File getOutputDirectory()
          Return the output directory of this handler
 void handleClassBegin(java.lang.Class<?> clazz)
          Invoked when the generator begin a new class.
 void handleClassEnd(java.lang.Class<?> clazz)
          Basic implementation of FlexGeneratorHandler.handleClassEnd(java.lang.Class)
 
Methods inherited from class com.liguorien.flex.generator.handlers.AbstractGeneratorHandler
addContextMethodWriter, addImport, addMethodWriter, addPropertyWriter, appendClassPrefix, clearImports, getAttributes, getClassName, getContextMethodWriters, getCurrentClass, getElements, getGenerator, getImports, getMethodWriters, getPropertyWriters, getRelativeFilePath, getWriter, handleClassBegin, handleClassEnd, handleProperty, initWriter, resetImports, setGenerator, setWriter, writeClassName, writeDocumentation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlexModelBuilderHandler

public FlexModelBuilderHandler()

FlexModelBuilderHandler

public FlexModelBuilderHandler(java.lang.String builderSuffix)
Creates a new instance of FlexModelBuilderHandler

Method Detail

getOutputDirectory

public java.io.File getOutputDirectory()
Description copied from class: AbstractGeneratorHandler

Return the output directory of this handler

Specified by:
getOutputDirectory in class AbstractGeneratorHandler<FlexModelBuilderHandler>
Returns:
A File object which represent the root of output directory

getBuilderSuffix

public java.lang.String getBuilderSuffix()

getClassType

public ClassType getClassType()
Description copied from class: AbstractGeneratorHandler

Get the ClassType for this handler.

Specified by:
getClassType in interface FlexGeneratorHandler
Specified by:
getClassType in class AbstractGeneratorHandler<FlexModelBuilderHandler>
Returns:
The ClassType of this handler.
See Also:
ClassType

handleClassBegin

public void handleClassBegin(java.lang.Class<?> clazz)
Description copied from interface: FlexGeneratorHandler
Invoked when the generator begin a new class.

Parameters:
clazz - The class which the generator is parsing.

handleClassEnd

public void handleClassEnd(java.lang.Class<?> clazz)
Description copied from class: AbstractGeneratorHandler

Basic implementation of FlexGeneratorHandler.handleClassEnd(java.lang.Class)

The default behavior is to invoke AbstractGeneratorHandler.handleClassEnd(Class clazz, ClassWriter cw) using AbstractGeneratorHandler.getClassWriter() as the ClassWriter.

Specified by:
handleClassEnd in interface FlexGeneratorHandler
Overrides:
handleClassEnd in class AbstractGeneratorHandler<FlexModelBuilderHandler>
Parameters:
clazz - The current class

appendClassSuffix

protected void appendClassSuffix(java.lang.StringBuilder buffer)
Description copied from class: AbstractGeneratorHandler

Appends a suffix to name of the generated class. The default behavior is to append (if not null) value of FlexGenerator.getClassSuffix().

Overrides:
appendClassSuffix in class AbstractGeneratorHandler<FlexModelBuilderHandler>
Parameters:
buffer - The buffer which the suffix must be appended.

appendExtension

protected void appendExtension(java.lang.StringBuilder buffer)
Description copied from class: AbstractGeneratorHandler

Appends the extension of the generated file.

Specified by:
appendExtension in class AbstractGeneratorHandler<FlexModelBuilderHandler>
Parameters:
buffer - The buffer which the extension must be appended.

getClassWriter

public ClassWriter getClassWriter()
Description copied from class: AbstractGeneratorHandler

Get the ClassWriter of this handler.

Specified by:
getClassWriter in class AbstractGeneratorHandler<FlexModelBuilderHandler>
Returns:
The ClassWriter of this handler.
See Also:
ClassWriter

FlexGenerator

Copyright 2006 Nicolas Désy. All rights reserved.