private void tryParseElExpression(final IDOMAttr attr){
  final IRegion attrValueRegion=XmlUtilities.getAttributeValueRegion(attr);
  String attrValue=attr.getNodeValue();
  if (attrValueRegion == null || attrValue == null) {
    return;
  }
  List<IRegion> exprContentRegions=UiBinderUtilities.getElExpressionRegions(attrValue);
  for (  final IRegion exprContentRegion : exprContentRegions) {
    String exprContents=attrValue.substring(exprContentRegion.getOffset(),exprContentRegion.getOffset() + exprContentRegion.getLength());
    ElExpressionFirstFragment firstFragment=UiBinderUtilities.findMatchingElExpressionFirstFragment(exprContents,firstFragmentComputer.getFirstFragments());
    if (firstFragment == null) {
      setFieldReferenceFirstFragmentUndefinedError(attrValueRegion,exprContentRegion,exprContents);
      continue;
    }
    String allButFirstFragment=UiBinderUtilities.getAllButFirstFragment(exprContents);
    int allButFirstFragmentOffsetInDoc=attrValueRegion.getOffset() + exprContentRegion.getOffset() + (exprContents.length() - allButFirstFragment.length());
    IType fieldType=UiBinderXmlModelUtilities.resolveElementToJavaType((IDOMElement)firstFragment.getNode(),javaProject);
    if (UiBinderXmlModelUtilities.isStyleElement(firstFragment.getNode())) {
      Region fieldRefRegion=new Region(exprContentRegion.getOffset() + attrValueRegion.getOffset(),exprContentRegion.getLength());
      tryParseCssElExpression((IDOMElement)firstFragment.getNode(),allButFirstFragment,allButFirstFragmentOffsetInDoc,fieldRefRegion);
    }
 else     if (fieldType != null) {
      tryParseJavaElExpression(fieldType,allButFirstFragment,allButFirstFragmentOffsetInDoc);
    }
  }
}

private void tryParseElExpression ( final IDOMAttr attr ) { final IRegion attrValueRegion = XmlUtilities . getAttributeValueRegion ( attr ) ; String attrValue = attr . getNodeValue ( ) ; if ( attrValueRegion == null || attrValue == null ) { return ; } List < IRegion > exprContentRegions = UiBinderUtilities . getElExpressionRegions ( attrValue ) ; for ( final IRegion exprContentRegion : exprContentRegions ) { String exprContents = attrValue . substring ( exprContentRegion . getOffset ( ) , exprContentRegion . getOffset ( ) + exprContentRegion . getLength ( ) ) ; ElExpressionFirstFragment firstFragment = UiBinderUtilities . findMatchingElExpressionFirstFragment ( exprContents , firstFragmentComputer . getFirstFragments ( ) ) ; if ( firstFragment == null ) { setFieldReferenceFirstFragmentUndefinedError ( attrValueRegion , exprContentRegion , exprContents ) ; continue ; } String allButFirstFragment = UiBinderUtilities . getAllButFirstFragment ( exprContents ) ; int allButFirstFragmentOffsetInDoc = attrValueRegion . getOffset ( ) + exprContentRegion . getOffset ( ) + ( exprContents . length ( ) - allButFirstFragment . length ( ) ) ; IType fieldType = UiBinderXmlModelUtilities . resolveElementToJavaType ( ( IDOMElement ) firstFragment . getNode ( ) , javaProject ) ; if ( UiBinderXmlModelUtilities . isStyleElement ( firstFragment . getNode ( ) ) ) { Region fieldRefRegion = new Region ( exprContentRegion . getOffset ( ) + attrValueRegion . getOffset ( ) , exprContentRegion . getLength ( ) ) ; tryParseCssElExpression ( ( IDOMElement ) firstFragment . getNode ( ) , allButFirstFragment , allButFirstFragmentOffsetInDoc , fieldRefRegion ) ; } else if ( fieldType != null ) { tryParseJavaElExpression ( fieldType , allButFirstFragment , allButFirstFragmentOffsetInDoc ) ; } } }
parses a field reference within an attribute .
