Package 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$ Mise a jour: $Date$ par : $Author$
- Author:
- Tony Chemit - chemit@codelutin.com
-
Method Summary
Modifier and Type Method Description booleanaccept(DataBinding binding)Test if a binding can be treated by the writer.java.lang.Class<B>getType()booleanisUsed()Test if the writer was at least used once (says that the methodwrite(DataBinding, JavaFileGenerator, StringBuilder)was at least invoked once).voidreset()Reset internal states.voidwrite(DataBinding binding, JavaFileGenerator generator, java.lang.StringBuilder buffer)Generate the creation code of the givenbindingand push it in the givenbuffer.
-
Method Details
-
accept
Test if a binding can be treated by the writer.- Parameters:
binding- the binding to test- Returns:
trueif this writer can be used to generate binding creation code,falseotherwise.
-
isUsed
boolean isUsed()Test if the writer was at least used once (says that the methodwrite(DataBinding, JavaFileGenerator, StringBuilder)was at least invoked once).- Returns:
trueif this writer was used
-
getType
java.lang.Class<B> getType()- Returns:
- the type of
JAXXBindingto generate
-
write
Generate the creation code of the givenbindingand push it in the givenbuffer. Note: after beean in this method, theisUsed()should always returntrue.- Parameters:
binding- the binding to usegenerator- common generator to build creation codebuffer- where to push creation code
-
reset
void reset()Reset internal states. At the moment, there is only theusedproperty which is internal and must be reset tofalsefor each compiler in order to know if a type of writer is used for the file.- Since:
- 2.4
-