Download Sources

com.liguorien.flex.generator.writers
Interface MethodWriter<T extends FlexGeneratorHandler>

All Known Implementing Classes:
BuilderMethodWriter, BuilderMethodWriter, ContextMethodWriter, ContextMethodWriter, GetArray, GetArrayElement, GetBasicArray, GetBasicMap, GetBasicMapXML, GetBasicXML, GetBasicXMLList, GetCollection, GetCollectionElement, GetElement, GetEntityArray, GetEntityArrayElement, GetEntityCollection, GetEntityCollectionElement, GetEntityMap, GetEntityMapElement, GetEntityMapXML, GetEntityXMLList, GetInstance, GetInstance, GetMap, GetMapElement, GetPrimitiveArrayElement, GetString, GetterSetter, GetXML

public interface MethodWriter<T extends FlexGeneratorHandler>

Defines a writer who generates an entire method.

Version:
0.2
Author:
Nicolas Désy

Field Summary
static java.util.Comparator<MethodWriter> COMPARATOR
          Comparator used to sort a List of MethodWriter
 
Method Summary
 boolean acceptClass(java.lang.Class<?> clazz)
          Determines if this writer accepts a class.
 int getPriority()
          Returns the priority for this writer.
 void writeMethod(java.io.Writer w, FlexGenerator g, T handler, java.lang.Class<?> clazz)
          Writes method signature and body to the writer
 

Field Detail

COMPARATOR

static final java.util.Comparator<MethodWriter> COMPARATOR
Comparator used to sort a List of MethodWriter

Method Detail

acceptClass

boolean acceptClass(java.lang.Class<?> clazz)
Determines if this writer accepts a class.

Parameters:
clazz - The class to check
Returns:
a boolean which indicated if the writer accepts the class

writeMethod

void writeMethod(java.io.Writer w,
                 FlexGenerator g,
                 T handler,
                 java.lang.Class<?> clazz)
                 throws java.io.IOException
Writes method signature and body to the writer

Parameters:
w - The Writer
g - The current generator
handler - The current handler
clazz - The current clazz
Throws:
java.io.IOException

getPriority

int getPriority()
Returns the priority for this writer. Writer with the highest value will be the first executed.

Returns:
The priority for this writer

FlexGenerator

Copyright 2006 Nicolas Désy. All rights reserved.