/**
  * Checks if the variable name is suitable for the current expression context.
  *
  * @param variable the variable to validate
  */
 @Check
 public void checkVariableName(JRVariableObj variable) {
   ExpressionContext currExpContext =
       ExpressionEditorSupportUtil.safeGetCurrentExpressionContext();
   List<JRVariable> allVariables = ExpressionContextUtils.getAllDatasetsVariables(currExpContext);
   for (JRVariable v : allVariables) {
     if (("{" + v.getName() + "}").equals(variable.getBracedIdentifier()))
       return; //$NON-NLS-1$ //$NON-NLS-2$
   }
   List<JRVariable> allCrosstabsVariables =
       ExpressionContextUtils.getAllCrosstabsVariables(currExpContext);
   for (JRVariable v : allCrosstabsVariables) {
     if (("{" + v.getName() + "}").equals(variable.getBracedIdentifier()))
       return; //$NON-NLS-1$ //$NON-NLS-2$
   }
   error(
       Messages.JavaJRExpressionJavaValidator_VariableNotFoundInContextError,
       variable,
       JavaJRExpressionPackage.Literals.JR_VARIABLE_OBJ__BRACED_IDENTIFIER,
       JavaJRExpressionPackage.JR_VARIABLE_OBJ__BRACED_IDENTIFIER);
 }
 /**
  * Checks if the parameter name is suitable for the current expression context.
  *
  * @param parameter the parameter to validate
  */
 @Check
 public void checkParameterName(JRParameterObj parameter) {
   ExpressionContext currExpContext =
       ExpressionEditorSupportUtil.safeGetCurrentExpressionContext();
   List<JRParameter> allParameters =
       ExpressionContextUtils.getAllDatasetsParameters(currExpContext);
   for (JRParameter p : allParameters) {
     if (("{" + p.getName() + "}").equals(parameter.getBracedIdentifier()))
       return; //$NON-NLS-1$ //$NON-NLS-2$
   }
   List<JRParameter> allCrosstabsParameters =
       ExpressionContextUtils.getAllCrosstabsParameters(currExpContext);
   for (JRParameter p : allCrosstabsParameters) {
     if (("{" + p.getName() + "}").equals(parameter.getBracedIdentifier()))
       return; //$NON-NLS-1$ //$NON-NLS-2$
   }
   error(
       Messages.JavaJRExpressionJavaValidator_ParameterNotFoundInContextError,
       parameter,
       JavaJRExpressionPackage.Literals.JR_PARAMETER_OBJ__BRACED_IDENTIFIER,
       JavaJRExpressionPackage.JR_PARAMETER_OBJ__BRACED_IDENTIFIER);
 }
 /**
  * Checks if the resource bundle key is suitable for the current expression context.
  *
  * @param parameter the resource bundle key to validate
  */
 @Check
 public void checkResourceBunleKey(JRResourceBundleKeyObj rbk) {
   ExpressionContext currExpContext =
       ExpressionEditorSupportUtil.safeGetCurrentExpressionContext();
   List<String> rbKeys = ExpressionContextUtils.getResourceBundleKeys(currExpContext);
   for (String k : rbKeys) {
     if (("{" + k + "}").equals(rbk.getBracedIdentifier())) return; // $NON-NLS-1$ //$NON-NLS-2$
   }
   error(
       Messages.JavaJRExpressionJavaValidator_RBKNotFoundInContextError,
       rbk,
       JavaJRExpressionPackage.Literals.JR_RESOURCE_BUNDLE_KEY_OBJ__BRACED_IDENTIFIER,
       JavaJRExpressionPackage.JR_RESOURCE_BUNDLE_KEY_OBJ__BRACED_IDENTIFIER);
 }
 /**
  * Checks if the field name is suitable for the current expression context.
  *
  * @param field the field to validate
  */
 @Check
 public void checkFieldName(JRFieldObj field) {
   ExpressionContext currExpContext =
       ExpressionEditorSupportUtil.safeGetCurrentExpressionContext();
   List<JRField> allFields = ExpressionContextUtils.getAllDatasetsFields(currExpContext);
   for (JRField f : allFields) {
     if (("{" + f.getName() + "}").equals(field.getBracedIdentifier()))
       return; //$NON-NLS-1$ //$NON-NLS-2$
   }
   error(
       Messages.JavaJRExpressionJavaValidator_FieldNotFoundInContextError,
       field,
       JavaJRExpressionPackage.Literals.JR_FIELD_OBJ__BRACED_IDENTIFIER,
       JavaJRExpressionPackage.JR_FIELD_OBJ__BRACED_IDENTIFIER);
 }