FlexProject project = builder.getProject();
builder.addExpressionDependency(project.getBindingManagerClass());
// Do some semantic checks.
IMXMLTagAttributeData sourceAttribute = tag.getTagAttributeData(ATTRIBUTE_SOURCE);
IMXMLTagAttributeData destinationAttribute = tag.getTagAttributeData(ATTRIBUTE_DESTINATION);
String trimmedSourceValue = null;
String trimmedDestinationValue = null;
if (sourceAttribute == null)
{
// 'source' attribute is required
ICompilerProblem problem = new MXMLRequiredAttributeProblem(tag, ATTRIBUTE_SOURCE);
builder.addProblem(problem);
markInvalidForCodeGen();
}
else
{
trimmedSourceValue = builder.getMXMLDialect().trim(sourceAttribute.getRawValue());
if (trimmedSourceValue.isEmpty())
{
// 'source' attribute value cannot be empty
ICompilerProblem problem = new MXMLEmptyAttributeProblem(sourceAttribute);
builder.addProblem(problem);
markInvalidForCodeGen();
}
}
if (destinationAttribute == null)
{
// 'destination' attribute is required
ICompilerProblem problem = new MXMLRequiredAttributeProblem(tag, ATTRIBUTE_DESTINATION);
builder.addProblem(problem);
markInvalidForCodeGen();
}
else
{
trimmedDestinationValue = builder.getMXMLDialect().trim(destinationAttribute.getRawValue());
if (trimmedDestinationValue.isEmpty())
{
// 'destination' attribute value cannot be empty
ICompilerProblem problem = new MXMLEmptyAttributeProblem(destinationAttribute);
builder.addProblem(problem);