jaxx.compiler.binding.writers
Interface JAXXBindingWriter<B extends JAXXBinding>

All Known Implementing Classes:
AbstractJAXXBindingWriter, DefaultJAXXBindingWriter, SimpleJAXXObjectBindingWriter

public interface JAXXBindingWriter<B extends JAXXBinding>

The contract of a writer of JAXXBinding creation code from a DataBinding.

Created: 5 déc. 2009

Version:
$Revision: 2225 $

Mise a jour: $Date: 2011-02-19 21:15:00 +0100 (Sat, 19 Feb 2011) $ par : $Author: tchemit $

Author:
tchemit

Method Summary
 boolean accept(DataBinding binding)
          Test if a binding can be treated by the writer.
 Class<B> getType()
           
 boolean isUsed()
          Test if the writer was at least used once (says that the method write(DataBinding, JavaFileGenerator, StringBuilder) was at least invoked once).
 void reset()
          Reset internal states.
 void write(DataBinding binding, JavaFileGenerator generator, StringBuilder buffer)
          Generate the creation code of the given binding and push it in the given buffer.
 

Method Detail

accept

boolean accept(DataBinding binding)
Test if a binding can be treated by the writer.

Parameters:
binding - the binding to test
Returns:
true if this writer can be used to generate binding creation code, false otherwise.

isUsed

boolean isUsed()
Test if the writer was at least used once (says that the method write(DataBinding, JavaFileGenerator, StringBuilder) was at least invoked once).

Returns:
true if this writer was used

getType

Class<B> getType()
Returns:
the type of JAXXBinding to generate

write

void write(DataBinding binding,
           JavaFileGenerator generator,
           StringBuilder buffer)
Generate the creation code of the given binding and push it in the given buffer.

Note: after beean in this method, the isUsed() should always return true.

Parameters:
binding - the binding to use
generator - common generator to build creation code
buffer - where to push creation code

reset

void reset()
Reset internal states.

At the moment, there is only the used property which is internal and must be reset to false for each compiler in order to know if a type of writer is used for the file.

Since:
2.4


Copyright © 2008-2011 CodeLutin. All Rights Reserved.