public class FieldManager extends Object
FieldWriter
instances created for the current
template.
Modification summary:
Line 98: Modified visibility from private to protected
Line 429: Modified visibility from private to protected
Most of the modifications have been made to allow extensionModifier and Type | Field and Description |
---|---|
protected com.google.gwt.uibinder.rebind.MortalLogger |
logger |
Constructor and Description |
---|
FieldManager(TypeOracle typeOracle,
com.google.gwt.uibinder.rebind.MortalLogger logger,
boolean useLazyWidgetBuilders) |
Modifier and Type | Method and Description |
---|---|
String |
convertFieldToGetter(String fieldName)
Converts the given field to its getter.
|
void |
disableOptimization(String fieldName)
Prevent a field from being optimized as only being referenced once (and therefore constant for
all intents).
|
com.google.gwt.uibinder.rebind.FieldReference |
findFieldReference(String expressionIn) |
static String |
getFieldBuilder(String fieldName) |
static String |
getFieldGetter(String fieldName) |
void |
initializeWidgetsInnerClass(com.google.gwt.uibinder.rebind.IndentedWriter w,
com.google.gwt.uibinder.rebind.model.OwnerClass ownerClass)
Initialize with field builders the generated Widgets inner class.
|
com.google.gwt.uibinder.rebind.FieldWriter |
lookup(String fieldName) |
void |
pop()
Remove the field at the top of the
parsedFieldStack . |
void |
push(com.google.gwt.uibinder.rebind.XMLElement source,
com.google.gwt.uibinder.rebind.FieldWriter fieldWriter) |
com.google.gwt.uibinder.rebind.FieldWriter |
registerField(com.google.gwt.uibinder.rebind.FieldWriterType fieldWriterType,
JClassType fieldType,
String fieldName)
Used to declare fields of an existing type.
|
com.google.gwt.uibinder.rebind.FieldWriter |
registerField(JClassType fieldType,
String fieldName) |
protected com.google.gwt.uibinder.rebind.FieldWriter |
registerField(String fieldName,
com.google.gwt.uibinder.rebind.FieldWriter field) |
com.google.gwt.uibinder.rebind.FieldWriter |
registerField(String type,
String fieldName) |
com.google.gwt.uibinder.rebind.FieldWriter |
registerFieldForGeneratedCssResource(com.google.gwt.uibinder.rebind.model.ImplicitCssResource cssResource)
Used to declare fields that will hold generated instances generated
CssResource interfaces.
|
com.google.gwt.uibinder.rebind.FieldWriter |
registerFieldForLazyDomElement(JClassType templateFieldType,
com.google.gwt.uibinder.rebind.model.OwnerField ownerField)
Register a new field for
LazyDomElement
types. |
com.google.gwt.uibinder.rebind.FieldWriter |
registerFieldOfGeneratedType(JClassType assignableType,
String typePackage,
String typeName,
String fieldName)
Used to declare fields of a type (other than CssResource) that is to be
generated.
|
void |
registerFieldReference(com.google.gwt.uibinder.rebind.XMLElement source,
String fieldReferenceString,
JType... types)
Called to register a
{field.reference} encountered during
parsing, to be validated against the type oracle once parsing is complete. |
com.google.gwt.uibinder.rebind.FieldWriter |
require(String fieldName)
Gets a FieldWriter given its name or throws a RuntimeException if not found.
|
static String |
stripFieldGetter(String fieldName) |
void |
validate()
To be called after parsing is complete.
|
void |
writeFieldDefinitions(com.google.gwt.uibinder.rebind.IndentedWriter writer,
TypeOracle typeOracle,
com.google.gwt.uibinder.rebind.model.OwnerClass ownerClass,
com.google.gwt.uibinder.rebind.DesignTimeUtils designTime)
Outputs the getter and builder definitions for all fields.
|
void |
writeGwtFieldsDeclaration(com.google.gwt.uibinder.rebind.IndentedWriter writer)
Writes all stored gwt fields.
|
public FieldManager(TypeOracle typeOracle, com.google.gwt.uibinder.rebind.MortalLogger logger, boolean useLazyWidgetBuilders)
public String convertFieldToGetter(String fieldName)
public void disableOptimization(String fieldName)
public com.google.gwt.uibinder.rebind.FieldReference findFieldReference(String expressionIn)
public void initializeWidgetsInnerClass(com.google.gwt.uibinder.rebind.IndentedWriter w, com.google.gwt.uibinder.rebind.model.OwnerClass ownerClass) throws UnableToCompleteException
FieldWriter.writeFieldBuilder(com.google.gwt.uibinder.rebind.IndentedWriter, int, com.google.gwt.uibinder.rebind.model.OwnerField)
.UnableToCompleteException
public com.google.gwt.uibinder.rebind.FieldWriter lookup(String fieldName)
fieldName
- the name of the FieldWriter
to findFieldWriter
instance indexed by fieldName or
null in case fieldName is not foundpublic void pop()
parsedFieldStack
.public void push(com.google.gwt.uibinder.rebind.XMLElement source, com.google.gwt.uibinder.rebind.FieldWriter fieldWriter)
source
- the element this field was parsed fromfieldWriter
- the field to push on the top of the
parsedFieldStack
public com.google.gwt.uibinder.rebind.FieldWriter registerField(com.google.gwt.uibinder.rebind.FieldWriterType fieldWriterType, JClassType fieldType, String fieldName) throws UnableToCompleteException
registerFieldOfGeneratedType(com.google.gwt.core.ext.typeinfo.JClassType, java.lang.String, java.lang.String, java.lang.String)
.
When making a field we peek at the parsedFieldStack
to make sure
that the field that holds the widget currently being parsed will depended
upon the field being declared. This ensures, for example, that dom id
fields (see UiBinderWriter#declareDomIdHolder()
) used by an HTMLPanel
will be declared before it is.
fieldWriterType
- the field writer type associatedfieldType
- the type of the new fieldfieldName
- the name of the new fieldFieldWriter
instanceUnableToCompleteException
- on duplicate namepublic com.google.gwt.uibinder.rebind.FieldWriter registerField(JClassType fieldType, String fieldName) throws UnableToCompleteException
UnableToCompleteException
public com.google.gwt.uibinder.rebind.FieldWriter registerField(String type, String fieldName) throws UnableToCompleteException
UnableToCompleteException
public com.google.gwt.uibinder.rebind.FieldWriter registerFieldForGeneratedCssResource(com.google.gwt.uibinder.rebind.model.ImplicitCssResource cssResource) throws UnableToCompleteException
registerField(com.google.gwt.uibinder.rebind.FieldWriterType, com.google.gwt.core.ext.typeinfo.JClassType, java.lang.String)
. For other generated types, use
registerFieldOfGeneratedType(com.google.gwt.core.ext.typeinfo.JClassType, java.lang.String, java.lang.String, java.lang.String)
registerFieldForGeneratedCssResource(com.google.gwt.uibinder.rebind.model.ImplicitCssResource)
.
When making a field we peek at the parsedFieldStack
to make sure
that the field that holds the widget currently being parsed will depended
upon the field being declared. This ensures, for example, that dom id
fields (see UiBinderWriter#declareDomIdHolder()
) used by an HTMLPanel
will be declared before it is.
FieldWriter
instanceUnableToCompleteException
- on duplicate namepublic com.google.gwt.uibinder.rebind.FieldWriter registerFieldForLazyDomElement(JClassType templateFieldType, com.google.gwt.uibinder.rebind.model.OwnerField ownerField) throws UnableToCompleteException
LazyDomElement
types. LazyDomElement fields can only be associated with html elements. Example:
templateFieldType
- the html type to bind, eg, SpanElement, DivElement, etcownerField
- the field instanceUnableToCompleteException
public com.google.gwt.uibinder.rebind.FieldWriter registerFieldOfGeneratedType(JClassType assignableType, String typePackage, String typeName, String fieldName) throws UnableToCompleteException
registerField(com.google.gwt.uibinder.rebind.FieldWriterType, com.google.gwt.core.ext.typeinfo.JClassType, java.lang.String)
. For generated CssResources, see
registerFieldForGeneratedCssResource(com.google.gwt.uibinder.rebind.model.ImplicitCssResource)
.
When making a field we peek at the parsedFieldStack
to make sure
that the field that holds the widget currently being parsed will depended
upon the field being declared. This ensures, for example, that dom id
fields (see UiBinderWriter#declareDomIdHolder()
) used by an HTMLPanel
will be declared before it is.
assignableType
- class or interface extened or implemented by this
typetypeName
- the full qualified name for the class associated with the
fieldfieldName
- the name of the fieldFieldWriter
instanceUnableToCompleteException
- on duplicate namepublic void registerFieldReference(com.google.gwt.uibinder.rebind.XMLElement source, String fieldReferenceString, JType... types)
{field.reference}
encountered during
parsing, to be validated against the type oracle once parsing is complete.public com.google.gwt.uibinder.rebind.FieldWriter require(String fieldName)
fieldName
- the name of the FieldWriter
to findFieldWriter
instance indexed by fieldNamepublic void validate() throws UnableToCompleteException
{field.reference}
s and checks they refer to existing types,
and have appropriate return types.UnableToCompleteException
- if any {field.references}
can't be resolvedpublic void writeFieldDefinitions(com.google.gwt.uibinder.rebind.IndentedWriter writer, TypeOracle typeOracle, com.google.gwt.uibinder.rebind.model.OwnerClass ownerClass, com.google.gwt.uibinder.rebind.DesignTimeUtils designTime) throws UnableToCompleteException
AbstractFieldWriter.writeFieldDefinition(com.google.gwt.uibinder.rebind.IndentedWriter, com.google.gwt.core.ext.typeinfo.TypeOracle, com.google.gwt.uibinder.rebind.model.OwnerField, com.google.gwt.uibinder.rebind.DesignTimeUtils, int, boolean)
.UnableToCompleteException
public void writeGwtFieldsDeclaration(com.google.gwt.uibinder.rebind.IndentedWriter writer) throws UnableToCompleteException
writer
- the writer to outputUnableToCompleteException
protected com.google.gwt.uibinder.rebind.FieldWriter registerField(String fieldName, com.google.gwt.uibinder.rebind.FieldWriter field) throws UnableToCompleteException
UnableToCompleteException
Copyright © 2010-2014 ArcBees. All Rights Reserved.