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

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


      if (registry.isExpressionRegistered(expression.getClass().getName()) == false)
      {
        continue;
      }

      final ExpressionMetaData emd =
          registry.getExpressionMetaData(expression.getClass().getName());
      if (emd.isElementLayoutProcessor())
      {
        writeExpression(bundle, state, expression, writer, BundleNamespaces.LAYOUT, "expression");// NON-NLS
      }
    }
  }
View Full Code Here


      if (registry.isExpressionRegistered(expression.getClass().getName()) == false)
      {
        continue;
      }

      final ExpressionMetaData emd =
          registry.getExpressionMetaData(expression.getClass().getName());
      if (emd.isGlobalLayoutProcessor())
      {
        return true;
      }
    }
    return false;
View Full Code Here

        return false;
      }

      if (ExpressionRegistry.getInstance().isExpressionRegistered(expressionType.getClass().getName()))
      {
        final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData
            (expressionType.getName());
        if (data.isElementLayoutProcessor() || data.isGlobalLayoutProcessor())
        {
          // ignore the expression ..
          return true;
        }
      }
View Full Code Here

    final ExpressionMetaData[] allExpressionMetaDatas = ExpressionRegistry.getInstance().getAllExpressionMetaDatas();
    final ArrayList<ExpressionMetaData> list = new ArrayList<ExpressionMetaData>();
    list.add(null);
    for (int i = 0; i < allExpressionMetaDatas.length; i++)
    {
      final ExpressionMetaData data = allExpressionMetaDatas[i];
      if (data.isHidden())
      {
        continue;
      }

      if (AggregationFunction.class.isAssignableFrom(data.getExpressionType()))
      {
        list.add(data);
      }
    }

    final Locale locale = Locale.getDefault();
    availableTypeNames = new String[list.size()];
    availableTypes = new Class[list.size()];
    for (int i = 0; i < list.size(); i++)
    {
      final ExpressionMetaData data = list.get(i);
      if (data == null)
      {
        availableTypeNames[i] = null;
        availableTypes[i] = null;
      }
      else
      {
        availableTypeNames[i] = data.getDisplayName(locale);
        availableTypes[i] = data.getExpressionType();
      }
    }
  }
View Full Code Here

    final ExpressionRegistry expressionRegistry = ExpressionRegistry.getInstance();
    final ExpressionMetaData[] allExpressions = expressionRegistry.getAllExpressionMetaDatas();
    for (int i = 0; i < allExpressions.length; i++)
    {
      final ExpressionMetaData expression = allExpressions[i];
      if (expression == null)
      {
        logger.warn("Null Expression encountered");
        continue;
      }
      if (isDeprecated(expression))
      {
        if (expression.isDeprecated() == false)
        {
          logger.warn("Expression code is deprecated, but metadata is not:" + expression.getExpressionType());
        }

        if ("Deprecated Function".equals(expression.getGrouping(Locale.US)) == false)
        {
          logger.warn("Expression metadata is not in deprecated group:" + expression.getExpressionType());
        }
      }
      else
      {
        if (expression.isDeprecated() == true)
        {
          logger.warn("Expression metadata is deprecated, but code is not:" + expression.getExpressionType());
        }
      }

    }
View Full Code Here

          inspectAttributeExpression(designerContext, reportRenderContext, resultHandler,
              columnNames, element, attrExprNamespace, name, expression, null);
        }
        else
        {
          final ExpressionMetaData metaData = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
          inspectAttributeExpression(designerContext, reportRenderContext, resultHandler,
              columnNames, element, attrExprNamespace, name, expression, metaData);
        }
      }
    }
View Full Code Here

        inspectStyleExpression(designerContext, reportRenderContext, resultHandler,
            columnNames, element, styleKey, expression, null);
      }
      else
      {
        final ExpressionMetaData metaData = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
        inspectStyleExpression(designerContext, reportRenderContext, resultHandler,
            columnNames, element, styleKey, expression, metaData);
      }
    }
  }
View Full Code Here

      inspectExpression(designerContext, reportRenderContext, resultHandler,
          columnNames, expression, null);
    }
    else
    {
      final ExpressionMetaData metaData = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
      inspectExpression(designerContext, reportRenderContext, resultHandler,
          columnNames, expression, metaData);
    }
  }
View Full Code Here

    }

    public void contentsChanged(final ListDataEvent e)
    {
      final ExpressionMetaData selectedItem = (ExpressionMetaData) expressionEditor.getSelectedItem();
      final Expression expression = getExpression();

      if (selectedItem == null)
      {
        if (expression != null)
        {
          setExpression(null);
        }
        return;
      }

      if (expression == null ||
          ObjectUtilities.equal(selectedItem.getExpressionType(), expression.getClass()) == false)
      {
        setExpression(selectedItem.create());
      }
    }
View Full Code Here

    final ArrayList<String> groupingsList = new ArrayList<String>(metaData.length);
    final HashMap<String, String> diagnosticMap = new HashMap<String, String>();
    String group = null;
    for (int sourceIdx = 0; sourceIdx < metaData.length; sourceIdx++)
    {
      final ExpressionMetaData data = metaData[sourceIdx];
      if (data.isHidden())
      {
        continue;
      }
      if (WorkspaceSettings.getInstance().isShowExpertItems() == false && data.isExpert())
      {
        continue;
      }
      if (WorkspaceSettings.getInstance().isShowDeprecatedItems() == false && data.isDeprecated())
      {
        continue;
      }
      if (StructureFunction.class.isAssignableFrom(data.getExpressionType()))
      {
        continue;
      }

      if (logger.isDebugEnabled())
      {
        logger.debug("Grouping : " + data.getGrouping(locale) + " - " + data.getGroupingOrdinal(locale) + " -> " + data.getExpressionType());
      }
      final String diagnosticGroup = group;
      if (sourceIdx == 0)
      {
        group = data.getGrouping(locale);
        groupingsList.add(group);
      }
      else
      {
        final String newgroup = data.getGrouping(locale);
        if ((ObjectUtilities.equal(newgroup, group)) == false)
        {
          if (groupingsList.contains(newgroup) == false)
          {
            group = newgroup;
            groupingsList.add(newgroup);
          }
          else
          {
            logger.warn("Warning: Misconfigured Expression-metadata: Group already processed: '" +
                newgroup + "' - " // NON-NLS
                data.getExpressionType() + " - Previous: " + diagnosticMap.get(diagnosticGroup));
          }
        }
      }

      diagnosticMap.put(group, data.getExpressionType().getName());
    }

    root = new ExpressionGroupingRoot();
    groupings = groupingsList.toArray(new String[groupingsList.size()]);

    expressionsByGroup = new HashNMap<String, ExpressionMetaData>();
    for (int i = 0; i < metaData.length; i++)
    {
      final ExpressionMetaData exMetaData = metaData[i];
      if (StructureFunction.class.isAssignableFrom(exMetaData.getExpressionType()))
      {
        continue;
      }

      if (exMetaData.isHidden())
      {
        continue;
      }
      if (WorkspaceSettings.getInstance().isShowExpertItems() == false && exMetaData.isExpert())
      {
        continue;
      }
      if (WorkspaceSettings.getInstance().isShowDeprecatedItems() == false && exMetaData.isDeprecated())
      {
        continue;
      }
      expressionsByGroup.add(exMetaData.getGrouping(Locale.getDefault()), exMetaData);
    }
  }
View Full Code Here

TOP

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

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.