Download Sources

com.liguorien.flex.generator.writers
Interface ClassWriter

All Known Implementing Classes:
AS3Writer, Dom4jWriter, MapKey, TextElement, TextElement

public interface ClassWriter

Version:
0.2
Author:
Nicolas Désy

Method Summary
 int getClassIndentationLevel()
          Returns the indentation level of the class declaration
 void writeClassDeclaration(java.io.Writer w, FlexGenerator g, java.lang.String className, java.lang.String subClass, java.util.Set<java.lang.String> interfaces)
          Writes package declaration
 void writeClassEnd(java.io.Writer w, FlexGenerator g)
          Writes class's end declaration.
 void writePackageDeclaration(java.io.Writer w, FlexGenerator g, java.lang.Class<?> clazz, java.util.Set<java.lang.String> imports)
          Writes package declaration
 void writeProperty(java.io.Writer w, FlexGenerator g, java.lang.String varName, java.beans.PropertyDescriptor prop, java.lang.String prefix, java.lang.String suffix, NodeType type)
          Writes code to access a property.
 

Method Detail

getClassIndentationLevel

int getClassIndentationLevel()
Returns the indentation level of the class declaration

Returns:
An integer which represents the indentation level (ie. java=0, as3=1)

writeProperty

void writeProperty(java.io.Writer w,
                   FlexGenerator g,
                   java.lang.String varName,
                   java.beans.PropertyDescriptor prop,
                   java.lang.String prefix,
                   java.lang.String suffix,
                   NodeType type)
                   throws java.io.IOException
Writes code to access a property.

Parameters:
w - The writer used to output the result
g - The current generator.
varName - The name of variable where the property is accessed
prop - The ProspectorDescriptor of the current property
prefix - The code to be written before generated code (can be null)
suffix - The code to be written after generated code (can be null)
type - The type of XML element for this property
Throws:
java.io.IOException - If an IO error occurs
See Also:
NodeType

writePackageDeclaration

void writePackageDeclaration(java.io.Writer w,
                             FlexGenerator g,
                             java.lang.Class<?> clazz,
                             java.util.Set<java.lang.String> imports)
                             throws java.io.IOException
Writes package declaration

Parameters:
w - The writer used to output the result
g - The current generator.
clazz - The current class
imports - A Set of import statement.
Throws:
java.io.IOException - If an IO error occurs

writeClassDeclaration

void writeClassDeclaration(java.io.Writer w,
                           FlexGenerator g,
                           java.lang.String className,
                           java.lang.String subClass,
                           java.util.Set<java.lang.String> interfaces)
                           throws java.io.IOException
Writes package declaration

Parameters:
w - The writer used to output the result
g - The current generator.
className - The name of the generated class
subClass - The subclass of the generated class (can be null)
interfaces - The interfaces implemented by the generated class (can be null)
Throws:
java.io.IOException

writeClassEnd

void writeClassEnd(java.io.Writer w,
                   FlexGenerator g)
                   throws java.io.IOException
Writes class's end declaration. Typically a closing curly brace.

Parameters:
w - The writer used to output the result
g - The current generator
Throws:
java.io.IOException

FlexGenerator

Copyright 2006 Nicolas Désy. All rights reserved.