Examples of AttributeMetaData


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

    if (expressionMetaData == null)
    {
      return;
    }

    final AttributeMetaData attributeMetaData =
        element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
    if (attributeMetaData == null)
    {
      return;
    }

    if (attributeMetaData.getCompatibilityLevel() > compatibilityLevel)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("ReportMigrationInspection.AttributeExpressionDefined",
              attributeMetaData.getDisplayName(Locale.getDefault()), element.getName(), compatibilityText),
          new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
    }

    if (expressionMetaData.getCompatibilityLevel() > compatibilityLevel)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("ReportMigrationInspection.AttributeExpressionInvalid",
              attributeMetaData.getDisplayName(Locale.getDefault()), element.getName(), compatibilityText),
          new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
    }
  }
View Full Code Here

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

                                final ReportElement element)
  {
    final AttributeMetaData[] datas = element.getMetaData().getAttributeDescriptions();
    for (int i = 0; i < datas.length; i++)
    {
      final AttributeMetaData data = datas[i];
      final Object value = element.getAttribute(data.getNameSpace(), data.getName());
      if (value instanceof String == false)
      {
        continue;
      }

      final String fmtString = (String) value;
      final String role = data.getValueRole();
      try
      {
        if ("NumberFormat".equals(role))//NON-NLS
        {
          final DecimalFormat fmt = new DecimalFormat(fmtString);
        }
        else if ("DateFormat".equals(role))//NON-NLS
        {
          //noinspection SimpleDateFormatWithoutLocale
          final DateFormat fmt = new SimpleDateFormat(fmtString);
        }
        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.AttributeInvalidFormat",
                element.getName(), data.getDisplayName(Locale.getDefault()), fmtString),
            new AttributeLocationInfo(element, data.getNameSpace(), data.getName(), false)));
      }

    }

    traverseAttributeExpressions(designerContext, reportRenderContext, resultHandler, columnNames, element);
View Full Code Here

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

            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

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

  {
    final ElementMetaData metaData = element.getMetaData();
    final AttributeMetaData[] attributeDescriptions = metaData.getAttributeDescriptions();
    for (int i = 0; i < attributeDescriptions.length; i++)
    {
      final AttributeMetaData attributeMetaData = attributeDescriptions[i];
      final Object value = element.getAttribute(attributeMetaData.getNameSpace(), attributeMetaData.getName());
      if (value != null)
      {
        if (attributeMetaData.getTargetType().isInstance(value) == false)
        {
          // notify of invalid type
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("MandatoryAttributeMissingInspection.AttributeValueHasInvalidType",
                  element.getName(), attributeMetaData.getDisplayName(Locale.getDefault()),
                  attributeMetaData.getTargetType().getName(), value.getClass().getName()),
              new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
        }

        if (attributeMetaData.isDesignTimeValue())
        {
          if (element.getAttributeExpression(attributeMetaData.getNameSpace(), attributeMetaData.getName()) != null)
          {
            // warn that design-time values have no need for a expression
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("MandatoryAttributeMissingInspection.DesignTimeAttributeWithExpression",
                    element.getName(), attributeMetaData.getDisplayName(Locale.getDefault())),
                new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
          }
        }
        continue;
      }

      if (attributeMetaData.isMandatory() == false)
      {
        continue;
      }
      if (attributeMetaData.isDesignTimeValue() == false)
      {
        if (element.getAttributeExpression(attributeMetaData.getNameSpace(), attributeMetaData.getName()) != null)
        {
          continue;
        }

        // warn that either value or expression must be set
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("MandatoryAttributeMissingInspection.MandatoryAttributeWithoutValueOrExpression",
                element.getName(), attributeMetaData.getDisplayName(Locale.getDefault())),
            new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));

      }
      else
      {
        // warn that a value must be set
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getString("MandatoryAttributeMissingInspection.MandatoryAttributeWithoutValue",
                element.getName(), attributeMetaData.getDisplayName(Locale.getDefault())),
            new AttributeLocationInfo(element, attributeMetaData.getNameSpace(), attributeMetaData.getName(), false)));
      }
    }
  }
View Full Code Here

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

                                final ReportElement element)
  {
    final AttributeMetaData[] datas = element.getMetaData().getAttributeDescriptions();
    for (int i = 0; i < datas.length; i++)
    {
      final AttributeMetaData metaData = datas[i];

      if (!"Group".equals(metaData.getValueRole()))//NON-NLS
      {
        continue;
      }

      final Object value = element.getAttribute(metaData.getNameSpace(), metaData.getName());
      final String[] groups = metaData.getReferencedGroups(element, value);
      for (int j = 0; j < groups.length; j++)
      {
        final String group = groups[j];
        final AbstractReportDefinition reportDefinition = reportRenderContext.getReportDefinition();
        final ReportElement e = reportDefinition.getGroupByName(group);
        if (e == null)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidGroupReferenceInspection.AttributeInvalidGroup",
                  element.getName(), group, metaData.getDisplayName(Locale.getDefault())),
              new AttributeLocationInfo(element, metaData.getNameSpace(), metaData.getName(), false)));
        }
      }
    }

  }
View Full Code Here

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

                                            final String attributeNamespace,
                                            final String attributeName,
                                            final Expression expression,
                                            final ExpressionMetaData expressionMetaData)
  {
    final AttributeMetaData attrDescr = element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
    if (attrDescr != null && attrDescr.isDeprecated())
    {
      final String message = attrDescr.getDeprecationMessage(Locale.getDefault());
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("DeprecatedUsagesInspection.StyleExpressionTargetDeprecated",
              element.getName(), attrDescr.getDisplayName(Locale.getDefault()), message),
          new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
    }

    if (expressionMetaData == null)
    {
      return;
    }

    if (expressionMetaData.isDeprecated() == false)
    {
      return;
    }
    final String message = expressionMetaData.getDeprecationMessage(Locale.getDefault());
    if (attrDescr != null)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("DeprecatedUsagesInspection.StyleExpressionDeprecated",
              element.getName(), attrDescr.getDisplayName(Locale.getDefault()), message),
          new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
    }
    else
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
View Full Code Here

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

      }

      final MetaData metaData = crosstabOption.getMetaData();
      if (metaData instanceof AttributeMetaData)
      {
        final AttributeMetaData attributeMetaData = (AttributeMetaData) metaData;
        if (namespace.equals(attributeMetaData.getNameSpace()) &&
            name.equals(attributeMetaData.getName()))
        {
          crosstabOption.setValue(value);
          fireTableCellUpdated(i, 1);
          return;
        }
View Full Code Here

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

      }

      final MetaData metaData = crosstabOption.getMetaData();
      if (metaData instanceof AttributeMetaData)
      {
        final AttributeMetaData attributeMetaData = (AttributeMetaData) metaData;
        if (namespace.equals(attributeMetaData.getNameSpace()) &&
            name.equals(attributeMetaData.getName()))
        {
          return crosstabOption.getValue();
        }
      }
    }
View Full Code Here

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

      }

      final MetaData metaData = crosstabOption.getMetaData();
      if (metaData instanceof AttributeMetaData)
      {
        final AttributeMetaData attributeMetaData = (AttributeMetaData) metaData;
        final Object value = e.getAttribute(attributeMetaData.getNameSpace(), attributeMetaData.getName());
        crosstabOption.setValue(value);
      }
    }
    fireTableDataChanged();
  }
View Full Code Here

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

      }

      final MetaData metaData = crosstabOption.getMetaData();
      if (metaData instanceof AttributeMetaData)
      {
        final AttributeMetaData attributeMetaData = (AttributeMetaData) metaData;
        e.setAttribute(attributeMetaData.getNameSpace(), attributeMetaData.getName(), crosstabOption.getValue());
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.