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 bu = new BeanUtility(expression);
        final ExpressionPropertyMetaData[] expressionProperties = emd.getPropertyDescriptions();
        boolean propertiesOpen = false;
        for (int i = 0; i < expressionProperties.length; i++)
        {
          final ExpressionPropertyMetaData metaData = expressionProperties[i];
          final String propertyName = metaData.getName();
          if (isFilteredProperty(propertyName))
          {
            continue;
          }
          if (metaData.isComputed())
          {
            continue;
          }
          if (propertiesOpen == false)
          {
View Full Code Here

    final String contentBasePath = String.valueOf(contentBasePathRaw);
    final ResourceManager resourceManager = state.getMasterReport().getResourceManager();

    for (int i = 0; i < datas.length; i++)
    {
      final ExpressionPropertyMetaData attributeMetaData = datas[i];
      final Object attValue = beanUtility.getProperty(attributeMetaData.getName());
      if (attValue == null)
      {
        continue;
      }
      final ResourceReference[] referencedResources = attributeMetaData.getReferencedResources
          (expression, attValue, report, resourceManager);
      for (int j = 0; j < referencedResources.length; j++)
      {
        final ResourceReference reference = referencedResources[j];
        if (reference.isLinked())
View Full Code Here

    final String typeName = metaData.getName();

    final ExpressionPropertyMetaData[] styleMetaDatas = metaData.getPropertyDescriptions();
    for (int j = 0; j < styleMetaDatas.length; j++)
    {
      final ExpressionPropertyMetaData propertyMetaData = styleMetaDatas[j];
      final String propertyDisplayName = propertyMetaData.getDisplayName(locale);
      if (isValid(propertyDisplayName, propertyMetaData.getName(), missingProperties) == false)
      {
        logger.warn("ExpressionMetaData '" + typeName + ": Property " + propertyMetaData.getName() + ": No DisplayName");
      }

      final String propertyGrouping = propertyMetaData.getGrouping(locale);
      if (isValid(propertyGrouping, "Required", missingProperties) == false)
      {
        logger.warn("ExpressionMetaData '" + typeName + ": Property " + propertyMetaData.getName() + ": Grouping is not valid");
      }
      if (propertyMetaData.isDeprecated())
      {
        final String deprecateMessage = propertyMetaData.getDeprecationMessage(locale);
        if (isValid(deprecateMessage, "Deprecated", missingProperties) == false)
        {
          logger.warn(
              "ExpressionMetaData '" + typeName + ": Property " + propertyMetaData.getName() + ": No valid deprecate message");
        }
      }
    }
  }
View Full Code Here

    final ExpressionPropertyMetaData[] attributes = type.getPropertyDescriptions();
    Arrays.sort(attributes, GroupedMetaDataComparator.ENGLISH);

    for (int j = 0; j < attributes.length; j++)
    {
      final ExpressionPropertyMetaData attribute = attributes[j];
      final String propertyPrefix = calculatePrefix(attribute);

      printMetadata(attribute, propertyPrefix, "display-name", attribute.getName());
      printMetadata(attribute, propertyPrefix, "grouping", "");
      printMetadata(attribute, propertyPrefix, "grouping.ordinal", "0");
      printMetadata(attribute, propertyPrefix, "ordinal", "0");
      printMetadata(attribute, propertyPrefix, "description", "");
      printMetadata(attribute, propertyPrefix, "deprecated", "");
View Full Code Here

          continue;
        }

        if (metaData != null)
        {
          final ExpressionPropertyMetaData data = metaData.getPropertyDescription(descriptor.getName());
          if (data != null)
          {
            continue;
          }
        }
View Full Code Here

        {
          return expressionType;
        }
        if (beanUtility != null && expressionMetaData != null)
        {
          final ExpressionPropertyMetaData propertyMetaData =
              expressionMetaData.getPropertyDescription(name);
          if (propertyMetaData != null)
          {
            try
            {
View Full Code Here

      expressionsByGroup.add(grouping, expression);

      final ExpressionPropertyMetaData[] properties = expression.getPropertyDescriptions();
      for (int j = 0; j < properties.length; j++)
      {
        final ExpressionPropertyMetaData propertyMetaData = properties[j];
        final String name = propertyMetaData.getName();
        if (StringUtils.isEmpty(name))
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property without a name");
        }
        final String propertyDisplayName = propertyMetaData.getDisplayName(locale);
        if (isValid(propertyDisplayName, name) == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": No DisplayName");
        }

        final String propertyGrouping = propertyMetaData.getGrouping(locale);
        if (isValid(propertyGrouping, "Group") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Grouping is not valid");
        }
        final int groupingOrdinal = propertyMetaData.getGroupingOrdinal(locale);
        if (groupingOrdinal == Integer.MAX_VALUE)
        {
          if (propertyMetaData instanceof DefaultExpressionMetaData)
          {
            final DefaultExpressionPropertyMetaData demd = (DefaultExpressionPropertyMetaData) propertyMetaData;
            missingProperties.add(demd.getKeyPrefix() + "grouping.ordinal=1000");
          }
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Grouping ordinal is not valid");
        }
        final int ordinal = propertyMetaData.getItemOrdinal(locale);
        if (groupingOrdinal == Integer.MAX_VALUE)
        {
          if (propertyMetaData instanceof DefaultExpressionMetaData)
          {
            final DefaultExpressionPropertyMetaData demd = (DefaultExpressionPropertyMetaData) propertyMetaData;
            missingProperties.add(demd.getKeyPrefix() + "ordinal=1000");
          }
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Ordinal is not valid");
        }
        final String propertyDescription = propertyMetaData.getDescription(locale);
        if (isValid(propertyDescription, "") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Description is not valid");
        }
        final String propertyDeprecated = propertyMetaData.getDeprecationMessage(locale);
        if (isValid(propertyDeprecated, "") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Deprecation is not valid");
        }

        final String role = propertyMetaData.getPropertyRole();
        if (isValid(role, "Value") == false)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Role is not valid");
        }
        final Class propertyType = propertyMetaData.getPropertyType();
        if (propertyType == null)
        {
          logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Property Type is not valid");
        }

        // should not crash!
        final PropertyDescriptor propertyDescriptor = propertyMetaData.getBeanDescriptor();

        if (propertyMetaData.isDeprecated())
        {
          final String deprecateMessage = propertyMetaData.getDeprecationMessage(locale);
          if (isValid(deprecateMessage, "Deprecated") == false)
          {
            logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": No valid deprecate message");
          }
        }

      }
View Full Code Here

    final ExpressionPropertyMetaData[] attributes = type.getPropertyDescriptions();
    Arrays.sort(attributes, GroupedMetaDataComparator.ENGLISH);

    for (int j = 0; j < attributes.length; j++)
    {
      final ExpressionPropertyMetaData attribute = attributes[j];
      final String propertyPrefix = calculatePrefix(attribute);

      printMetadata(attribute, propertyPrefix, "display-name", attribute.getName());
      printMetadata(attribute, propertyPrefix, "grouping", "");
      printMetadata(attribute, propertyPrefix, "grouping.ordinal", "0");
      printMetadata(attribute, propertyPrefix, "ordinal", "0");
      printMetadata(attribute, propertyPrefix, "description", "");
      printMetadata(attribute, propertyPrefix, "deprecated", "");
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];
        if (metaData.isHidden())
        {
          continue;
        }
        if (WorkspaceSettings.getInstance().isShowExpertItems() == false && metaData.isExpert())
        {
          continue;
        }
        if (WorkspaceSettings.getInstance().isShowDeprecatedItems() == false && metaData.isDeprecated())
        {
          continue;
        }

        if (MetaData.VALUEROLE_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

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.