Download Sources

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

All Known Implementing Classes:
ArrayElement, ArrayElement, ArrayProperty, BasicArrayProperty, BasicElement, BasicMapElement, BasicMapProperty, BasicProperty, BuilderPropertyWriter, CollectionElement, CollectionProperty, E4XElement, E4XProperty, EntityArrayProperty, EntityElement, EntityElement, EntityMapElement, EntityMapProperty, EntityProperty, EntityProperty, MapElement, MapProperty, SimpleElement, StringProperty

public interface PropertyWriter<T extends FlexGeneratorHandler>

Defines a writer who generates code to access a property.

Version:
0.2
Author:
Nicolas Désy

Field Summary
static java.util.Comparator<PropertyWriter> COMPARATOR
          Comparator used to sort a List of PropertyWriter
 
Method Summary
 boolean acceptProperty(java.beans.PropertyDescriptor prop, T handler)
          Determines if this writer accepts to write the property
 int getPriority()
          Returns the priority for this writer.
 void writeProperty(java.io.Writer w, FlexGenerator g, T handler, java.lang.String varName, java.beans.PropertyDescriptor prop)
          Writes code to access a property.
 

Field Detail

COMPARATOR

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

Method Detail

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

acceptProperty

boolean acceptProperty(java.beans.PropertyDescriptor prop,
                       T handler)
Determines if this writer accepts to write the property

Parameters:
prop - The property to check
handler - The current generator handler
Returns:
A boolean value which indicates if the writer accepts to write the property

writeProperty

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

Parameters:
w - The Writer
g - The current generator
handler - The current handler
varName - The name of variable where the property is accessed
prop - The ProspectorDescriptor of the current property
Throws:
java.io.IOException

FlexGenerator

Copyright 2006 Nicolas Désy. All rights reserved.