Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JRExpression


    verifyVariables(dataset);

    verifyGroups(dataset);

    JRExpression filterExpression = dataset.getFilterExpression();
    if (filterExpression != null)
    {
      try
      {
        Class valueClass = filterExpression.getValueClass();
        if (valueClass == null)
        {
          addBrokenRule("Class not set for filter expression.", filterExpression);
        }
        else if (!Boolean.class.isAssignableFrom(valueClass))
View Full Code Here


    if (name == null)
    {
      addBrokenRule("Property name missing.", propertyExpression);
    }
   
    JRExpression expr = propertyExpression.getValueExpression();
    if (expr == null)
    {
      addBrokenRule("Property value expression missing.", propertyExpression);
    }
    else
    {
      String valueExprClassName = expr.getValueClassName();
      if (valueExprClassName == null)
      {
        addBrokenRule("Class not set for property value expression.", expr);
      }
      else if (!String.class.getName().equals(valueExprClassName))
View Full Code Here

  }

  protected void verifyTitleExpression(JRVerifier verifier,
      PieChartComponent chart)
  {
    JRExpression titleExpression = chart.getTitleExpression();
    if (titleExpression == null)
    {
      verifier.addBrokenRule("No title expression for pie chart", chart);
    }
    else
    {
      String valueClass = titleExpression.getValueClassName();
      if (valueClass == null)
      {
        verifier.addBrokenRule("No value class for pie chart title expression",
            titleExpression);
      }
View Full Code Here

  protected void verify(JRVerifier verifier, PieDataset dataset)
  {
    verifier.verifyElementDataset(dataset);
   
    JRExpression keyExpression = dataset.getKeyExpression();
    if (keyExpression == null)
    {
      verifier.addBrokenRule("No key expression for pie chart dataset", dataset);
    }
    else
    {
      String valueClass = keyExpression.getValueClassName();
      if (valueClass == null)
      {
        verifier.addBrokenRule("No value class for key chart dataset key expression",
            keyExpression);
      }
      else if (!"java.lang.String".equals(valueClass))
      {
        verifier.addBrokenRule("Class " + valueClass
            + " not supported for key chart dataset key expression. Use java.lang.String instead.",
            keyExpression);
      }
    }
   
    JRExpression valueExpression = dataset.getValueExpression();
    if (valueExpression == null)
    {
      verifier.addBrokenRule("No value expression for key chart dataset", dataset);
    }
    else
    {
      String valueClass = valueExpression.getValueClassName();
      if (valueClass == null)
      {
        verifier.addBrokenRule("No value class for key chart dataset value expression",
            valueExpression);
      }
View Full Code Here

    sb.append("        switch (id)\n");
    sb.append("        {\n");

    for (int i = 0; it.hasNext() && i < EXPR_MAX_COUNT_PER_METHOD; i++)
    {
      JRExpression expression = (JRExpression)it.next();
     
      sb.append("            case ");
      sb.append(sourceTask.getExpressionId(expression));
      sb.append(" : \n");
      sb.append("            {\n");
      sb.append("                value = (");
      sb.append(expression.getValueClassName());
      sb.append(")(");
      sb.append(this.generateExpression(expression, evaluationType));
      sb.append(");");
      appendExpressionComment(sb, expression);
      sb.append("\n");
View Full Code Here

    List expressions = new ArrayList();
    int start = 0;
    int end = sourceCode.indexOf('\n');
    while (end >= 0)
    {
      JRExpression expression = null;
      if (start < end)
      {
        String line = sourceCode.substring(start, end);
        expression = getLineExpression(line);
      }
View Full Code Here

  }


  protected JRExpression getLineExpression(String line)
  {
    JRExpression expression = null;
    int exprIdStart = line.indexOf(SOURCE_EXPRESSION_ID_START);
    if (exprIdStart >= 0)
    {
      exprIdStart += SOURCE_EXPRESSION_ID_START_LENGTH;
      int exprIdEnd = line.indexOf('$', exprIdStart);
View Full Code Here

   */
  protected Format getFormat()//FIXMEFORMAT optimize this with an interface
  {
    Format format = null;

    JRExpression valueExpression = getExpression();
    if (valueExpression != null)
    {
      Class valueClass = valueExpression.getValueClass();
      if (java.util.Date.class.isAssignableFrom(valueClass))
      {
        format = filler.getDateFormat(getPattern());
      }
      else if (java.lang.Number.class.isAssignableFrom(valueClass))
View Full Code Here

  protected String getTemplatePattern()//FIXMEFORMAT optimize this with an interface
  {
    String pattern = null;
    String originalPattern = getPattern();
    Format format = getFormat();
    JRExpression valueExpression = getExpression();
    if (format != null && valueExpression != null)
    {
      Class valueClass = valueExpression.getValueClass();
      if (java.util.Date.class.isAssignableFrom(valueClass))
      {
        if (format instanceof SimpleDateFormat)
        {
          pattern = ((SimpleDateFormat) format).toPattern();
View Full Code Here

  protected void createCompiledBarcode(BarcodeComponent barcode)
  {
    compiledComponent = barcode.cloneObject();
   
    JRExpression compiledCodeExpression = baseFactory.getExpression(
        barcode.getCodeExpression());
    compiledComponent.setCodeExpression(compiledCodeExpression);
   
    JRExpression compiledPatternExpression = baseFactory.getExpression(
        barcode.getPatternExpression());
    compiledComponent.setPatternExpression(compiledPatternExpression);
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JRExpression

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.