Package org.pentaho.reporting.engine.classic.core.metadata

Examples of org.pentaho.reporting.engine.classic.core.metadata.ExpressionPropertyMetaData


      final BeanUtility utility = new BeanUtility(expression);

      final ExpressionPropertyMetaData[] datas = expressionMetaData.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        if (metaData.isHidden())
        {
          continue;
        }
        if (WorkspaceSettings.getInstance().isShowExpertItems() == false && metaData.isExpert())
        {
          continue;
        }
        if (WorkspaceSettings.getInstance().isShowDeprecatedItems() == false && metaData.isDeprecated())
        {
          continue;
        }
        final Object o = utility.getProperty(metaData.getName());
        if (metaData.isMandatory() && o == null)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("ExpressionsParameterInspection.MandatoryPropertyMissing",
                  expression.getName(), metaData.getDisplayName(Locale.getDefault())),
              new PropertyLocationInfo(expression, metaData.getName())));
        }
      }

      if (expression instanceof ValidateableExpression)
      {
View Full Code Here


    {
      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionPropertyMetaData[] propertyDescriptions = expressionMetaData.getPropertyDescriptions();
      for (int x = 0; x < propertyDescriptions.length; x++)
      {
        final ExpressionPropertyMetaData metaData = propertyDescriptions[x];
        final Object o = utility.getProperty(metaData.getName());
        final String[] referencedFields = metaData.getReferencedFields(expression, o);
        for (int y = 0; y < referencedFields.length; y++)
        {
          final String field = referencedFields[y];
          if (isValidField(field, columnNames) == false)
          {
            final AttributeMetaData attrMetaData =
                element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
            if (attrMetaData == null)
            {
              resultHandler.notifyInspectionResult(new InspectionResult(this, Severity.WARNING,
                  Messages.getString("InvalidFieldReferenceInspection.AttributeExpressionInvalidFieldNoMetaData",
                      element.getName(), attributeNamespace, attributeName, field, metaData.getDisplayName(Locale.getDefault())),
                  new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())
              ));
            }
            else
            {
              resultHandler.notifyInspectionResult(new InspectionResult(this, Severity.WARNING,
                  Messages.getString("InvalidFieldReferenceInspection.AttributeExpressionInvalidField",
                      element.getName(), attrMetaData.getDisplayName(Locale.getDefault()), field, metaData.getDisplayName(Locale.getDefault())),
                  new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())
              ));
            }
          }
        }
      }
View Full Code Here

    {
      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionPropertyMetaData[] propertyDescriptions = expressionMetaData.getPropertyDescriptions();
      for (int x = 0; x < propertyDescriptions.length; x++)
      {
        final ExpressionPropertyMetaData metaData = propertyDescriptions[x];
        final Object o = utility.getProperty(metaData.getName());
        final String[] referencedFields = metaData.getReferencedFields(expression, o);
        for (int y = 0; y < referencedFields.length; y++)
        {
          final String field = referencedFields[y];
          if (isValidField(field, columnNames) == false)
          {
            final StyleMetaData styleDescription = element.getMetaData().getStyleDescription(styleKey);
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidFieldReferenceInspection.StyleExpressionInvalidField",
                    element.getName(), styleDescription.getDisplayName(Locale.getDefault()),
                    field, metaData.getDisplayName(Locale.getDefault())),
                new StyleExpressionPropertyLocationInfo(element, styleKey, metaData.getName())
            ));
          }
        }
      }
    }
View Full Code Here

    {
      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionPropertyMetaData[] datas = expressionMetaData.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        final Object o = utility.getProperty(metaData.getName());
        final String[] referencedFields = metaData.getReferencedFields(expression, o);
        for (int j = 0; j < referencedFields.length; j++)
        {
          final String field = referencedFields[j];
          if (isValidField(field, columnNames) == false)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidFieldReferenceInspection.ExpressionInvalidField", expression.getName(),
                    field, metaData.getDisplayName(Locale.getDefault())),
                new PropertyLocationInfo(expression, metaData.getName())
            ));
          }
        }
      }
    }
View Full Code Here

    {
      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionPropertyMetaData[] propertyDescriptions = expressionMetaData.getPropertyDescriptions();
      for (int x = 0; x < propertyDescriptions.length; x++)
      {
        final ExpressionPropertyMetaData metaData = propertyDescriptions[x];
        final Object o = utility.getProperty(metaData.getName());
        final String[] referencedFields = metaData.getReferencedFields(expression, o);
        for (int y = 0; y < referencedFields.length; y++)
        {
          final String field = referencedFields[y];
          if (isValidField(field, columnNames) == false)
          {
            final StyleMetaData styleDescription = element.getMetaData().getStyleDescription(styleKey);
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidFieldReferenceInspection.StyleExpressionInvalidField",
                    element.getName(), styleDescription.getDisplayName(Locale.getDefault()),
                    field, metaData.getDisplayName(Locale.getDefault())),
                new StyleExpressionPropertyLocationInfo(element, styleKey, metaData.getName())));
          }
        }
      }
    }
    catch (Exception e)
View Full Code Here

      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
      final ExpressionPropertyMetaData[] datas = data.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        final Object o = utility.getProperty(metaData.getName());
        final String[] referencedFields = metaData.getReferencedFields(expression, o);
        for (int j = 0; j < referencedFields.length; j++)
        {
          final String field = referencedFields[j];
          if (isValidField(field, columnNames) == false)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidFieldReferenceInspection.ExpressionInvalidField", expression.getName(),
                    field, metaData.getDisplayName(Locale.getDefault())),
                new PropertyLocationInfo(expression, metaData.getName())));
          }
        }
      }
    }
    catch (Exception e)
View Full Code Here

      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
      final ExpressionPropertyMetaData[] datas = data.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        if (metaData.isHidden())
        {
          continue;
        }

        if ("Formula".equals(metaData.getPropertyRole()) == false)//NON-NLS
        {
          continue;
        }

        final Object o = utility.getProperty(metaData.getName());
        if (o instanceof String == false)
        {
          continue;
        }

        try
        {
          compileFormula((String) o);
        }
        catch (ParseException fpe)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("FormulaErrorInspection.ExpressionInvalidFormula", expression.getName(),
                  metaData.getDisplayName(Locale.getDefault())),
              new PropertyLocationInfo(expression, metaData.getName())));
        }
      }
    }
    catch (Exception e)
    {
View Full Code Here

      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
      final ExpressionPropertyMetaData[] datas = data.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        if (metaData.isHidden())
        {
          continue;
        }
        final Object o = utility.getProperty(metaData.getName());
        if (metaData.isMandatory() && o == null)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("ExpressionsParameterInspection.MandatoryPropertyMissing",
                  expression.getName(), metaData.getDisplayName(Locale.getDefault())),
              new PropertyLocationInfo(expression, metaData.getName())));
        }
      }

      if (expression instanceof ValidateableExpression)
      {
View Full Code Here

      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
      final ExpressionPropertyMetaData[] datas = data.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        if (metaData.isHidden())
        {
          continue;
        }
        if ("name".equals(metaData.getName()))
        {
          continue;
        }

        final Object o = utility.getProperty(metaData.getName());
        if (metaData.isMandatory() && o == null)
        {
          final AttributeMetaData attributeMetaData =
              element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
          if (attributeMetaData == null)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("ExpressionsParameterInspection.AttributeExpressionMandatoryPropertyMissingNoMetaData",
                    element.getName(), attributeNamespace, attributeName, metaData.getDisplayName(Locale.getDefault())),
                new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
          }
          else
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("ExpressionsParameterInspection.AttributeExpressionMandatoryPropertyMissing",
                    element.getName(), attributeMetaData.getDisplayName(Locale.getDefault()),
                    metaData.getDisplayName(Locale.getDefault())),
                new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
          }

        }
      }
View Full Code Here

      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
      final ExpressionPropertyMetaData[] datas = data.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        if (metaData.isHidden())
        {
          continue;
        }
        if ("name".equals(metaData.getName()))
        {
          continue;
        }

        final Object o = utility.getProperty(metaData.getName());
        if (metaData.isMandatory() && o == null)
        {
          final StyleMetaData description = element.getMetaData().getStyleDescription(styleKey);
          final String displayName;
          if (description == null)
          {
            displayName = styleKey.getName();
          }
          else
          {
            displayName = description.getDisplayName(Locale.getDefault());
          }

          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("ExpressionsParameterInspection.StyleExpressionMandatoryPropertyMissing",
                  element.getName(), displayName, metaData.getDisplayName(Locale.getDefault())),
              new StyleExpressionPropertyLocationInfo(element, styleKey, metaData.getName())));
        }
      }

      if (expression instanceof ValidateableExpression)
      {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.metadata.ExpressionPropertyMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.