com.google.gwt.uibinder.rebind
Interface FieldWriter


public interface FieldWriter

Models a field to be written in the generated binder code. Note that this is not necessarily a field that the user has declared. It's basically any variable the generated UiBinder#createAndBindUi implementation will need.

A field can have a custom initialization statement, set via setInitializer(java.lang.String). Without one it will be initialized via a GWT.create(java.lang.Class) call. (In the rare case that you need a field not to be initialized, initialize it to "null".)

Dependencies can be declared between fields via needs(com.google.gwt.uibinder.rebind.FieldWriter), to ensure that one can be initialized via reference to another. Circular references are not supported, nor detected.


Method Summary
 JClassType getAssignableType()
           
 java.lang.String getInitializer()
           
 JClassType getInstantiableType()
           
 java.lang.String getQualifiedSourceName()
           
 JType getReturnType(java.lang.String[] path, MonitoredLogger logger)
           
 void needs(FieldWriter f)
          Declares that the receiver depends upon the given field.
 void setInitializer(java.lang.String initializer)
          Used to provide an initializer string to use instead of a com.google.gwt.core.client.GWT#create() call.
 void write(IndentedWriter w)
          Write the field delcaration.
 

Method Detail

getAssignableType

JClassType getAssignableType()
Returns:
the type of this field, or for generated types the type it extends

getInitializer

java.lang.String getInitializer()
Returns:
the custom initializer for this field, or null if it is not set

getInstantiableType

JClassType getInstantiableType()
Returns:
the type of this field, or null if this field is of a type that has not yet been generated

getQualifiedSourceName

java.lang.String getQualifiedSourceName()
Returns:
the qualified source name of this type

getReturnType

JType getReturnType(java.lang.String[] path,
                    MonitoredLogger logger)
Returns:
the return type found at the end of the given method call path, which must begin with the receiver's name, or null if the path is invalid

needs

void needs(FieldWriter f)
Declares that the receiver depends upon the given field.


setInitializer

void setInitializer(java.lang.String initializer)
Used to provide an initializer string to use instead of a com.google.gwt.core.client.GWT#create() call. Note that this is an RHS expression. Don't include the leading '=', and don't end it with ';'.

Throws:
UnableToCompleteException
java.lang.IllegalStateException - on second attempt to set the initializer

write

void write(IndentedWriter w)
           throws UnableToCompleteException
Write the field delcaration.

Throws:
UnableToCompleteException