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

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


  {
    if (column == 0)
    {
      return null;
    }
    final ExpressionPropertyMetaData metaData = getMetaData(row);
    if (metaData == null)
    {
      return null;
    }
    return metaData.getExtraCalculationFields();
  }
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, InspectionResult.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, InspectionResult.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());
        if (o instanceof String == false)
        {
          continue;
        }
        final String fmtString = (String) o;
        final String role = metaData.getPropertyRole();
        try
        {
          if ("NumberFormat".equals(role))//NON-NLS
          {
            final DecimalFormat fmt = new DecimalFormat(String.valueOf(o));
          }
          else if ("DateFormat".equals(role))//NON-NLS
          {
            //noinspection SimpleDateFormatWithoutLocale
            final DateFormat fmt = new SimpleDateFormat(String.valueOf(o));
          }
          else if ("Message".equals(role))//NON-NLS
          {
            final MessageFormatSupport support = new MessageFormatSupport();
            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          final AttributeMetaData attrMetaData =
              element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
          if (attrMetaData == null)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidFormatInspection.AttributeExpressionInvalidFormatNoMetaData",
                    element.getName(), attributeNamespace, attributeName, fmtString, metaData.getDisplayName(Locale.getDefault())),
                new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
          }
          else
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidFormatInspection.AttributeExpressionInvalidFormat",
                    element.getName(), attrMetaData.getDisplayName(Locale.getDefault()), fmtString, 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());
        if (o instanceof String == false)
        {
          continue;
        }
        final String fmtString = (String) o;
        final String role = metaData.getPropertyRole();
        try
        {
          if ("NumberFormat".equals(role))//NON-NLS
          {
            final DecimalFormat fmt = new DecimalFormat(String.valueOf(o));
          }
          else if ("DateFormat".equals(role))//NON-NLS
          {
            //noinspection SimpleDateFormatWithoutLocale
            final DateFormat fmt = new SimpleDateFormat(String.valueOf(o));
          }
          else if ("Message".equals(role))//NON-NLS
          {
            final MessageFormatSupport support = new MessageFormatSupport();
            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          final StyleMetaData attrMetaData = element.getMetaData().getStyleDescription(styleKey);
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidFormatInspection.StyleExpressionInvalidFormat",
                  element.getName(), attrMetaData.getDisplayName(Locale.getDefault()), fmtString, 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());
        if (o instanceof String == false)
        {
          continue;
        }
        final String fmtString = (String) o;
        final String role = metaData.getPropertyRole();
        try
        {
          if ("NumberFormat".equals(role))//NON-NLS
          {
            final DecimalFormat fmt = new DecimalFormat(String.valueOf(o));
          }
          else if ("DateFormat".equals(role))//NON-NLS
          {
            //noinspection SimpleDateFormatWithoutLocale
            final DateFormat fmt = new SimpleDateFormat(String.valueOf(o));
          }
          else if ("Message".equals(role))//NON-NLS
          {
            final MessageFormatSupport support = new MessageFormatSupport();
            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidFormatInspection.ExpressionInvalidFormat",
                  expression.getName(), data.getDisplayName(Locale.getDefault()), fmtString, metaData.getDisplayName(Locale.getDefault())),
              new PropertyLocationInfo(expression, metaData.getName())));
        }
      }
    }
    catch (Exception e)
    {
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.