// use the attribute's context plus the offset into the
// whole attribute value to find where we think the el
// expression starts. Add one since the attribute value
// string returned by attrAdapter will have the value quotes
// removed, but the region offsets include the quotes.
IStructuredDocumentContext elContext = IStructuredDocumentContextFactory.INSTANCE
.getContext(context.getStructuredDocument(), context
.getDocumentPosition()
+ offsetOfFirstEL + 1);
final DTELExpression elExpression = adapter
.getELExpression(elContext);
if (elExpression != null)
{
final String elText = elExpression.getText();
if (DEBUG)
{
System.out.println(addDebugSpacer(3) + "EL attrVal= " //$NON-NLS-1$
+ elText);
}
elContext = elExpression.getDocumentContext();
// EL validation is user configurable because
// it can be computationally costly.
if (_validationContext.shouldValidateEL())
{
// also, skip the validation if the expression is empty
// or only whitespace, since the parser doesn't handle
// it
// anyway.
if ("".equals(elText.trim())) //$NON-NLS-1$
{
final int offset = elContext.getDocumentPosition() - 1;
final int length = elText.length() + 2;
final Diagnostic diagnostic = _validationContext
.getDiagnosticFactory()
.create_EMPTY_EL_EXPRESSION();
// detected empty EL expression