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

Examples of org.pentaho.reporting.engine.classic.core.ReportDataFactoryException


      throws ReportDataFactoryException
  {
    final int parameterEndIdx = query.lastIndexOf(')');
    if (parameterEndIdx < parameterStartIdx)
    {
      throw new ReportDataFactoryException("Malformed query: " + query); //$NON-NLS-1$
    }
    final String parameterText =
        query.substring(parameterStartIdx + 1, parameterEndIdx);
    final CSVTokenizer tokenizer = new CSVTokenizer(parameterText, ",", "\"", false);
    final int size = tokenizer.countTokens();
View Full Code Here


  {
    final ClassLoader classLoader = getClassLoader();

    if (classLoader == null)
    {
      throw new ReportDataFactoryException("No classloader!"); //$NON-NLS-1$
    }
    try
    {
      final Class c = Class.forName(className, false, classLoader);
      if (Modifier.isAbstract(c.getModifiers()))
      {
        throw new ReportDataFactoryException("Abstract class cannot be handled!"); //$NON-NLS-1$
      }

      final Method[] methods = c.getMethods();
      for (int i = 0; i < methods.length; i++)
      {
        final Method method = methods[i];
        if (Modifier.isPublic(method.getModifiers()) == false)
        {
          continue;
        }
        if (method.getName().equals(methodName) == false)
        {
          continue;
        }
        final Class returnType = method.getReturnType();
        if (TableModel.class.isAssignableFrom(returnType) == false)
        {
          continue;
        }
        if (method.getParameterTypes().length != paramCount)
        {
          continue;
        }
        return method;
      }
    }
    catch (ClassNotFoundException e)
    {
      throw new ReportDataFactoryException("No such Class: " + className, e); //$NON-NLS-1$
    }
    throw new ReportDataFactoryException("No such Method: " + className + '#' + methodName); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

      throws ReportDataFactoryException
  {
    final ClassLoader classLoader = getClassLoader();
    if (classLoader == null)
    {
      throw new ReportDataFactoryException("No classloader!"); //$NON-NLS-1$
    }

    try
    {
      final Class c = Class.forName(className, false, classLoader);
      if (TableModel.class.isAssignableFrom(c) == false)
      {
        throw new ReportDataFactoryException
            ("The specified class must be either a TableModel or a ReportData implementation: " + className); //$NON-NLS-1$
      }
      if (Modifier.isAbstract(c.getModifiers()))
      {
        throw new ReportDataFactoryException
            ("The specified class cannot be instantiated: it is abstract:" + className); //$NON-NLS-1$
      }

      final Constructor[] methods = c.getConstructors();
      for (int i = 0; i < methods.length; i++)
      {
        final Constructor method = methods[i];
        if (Modifier.isPublic(method.getModifiers()) == false)
        {
          continue;
        }
        if (method.getParameterTypes().length != paramCount)
        {
          continue;
        }
        return method;
      }
    }
    catch (ClassNotFoundException e)
    {
      throw new ReportDataFactoryException("No such Class", e); //$NON-NLS-1$
    }
    throw new ReportDataFactoryException
        ("There is no constructor in class " + className + //$NON-NLS-1$
            " that accepts " + paramCount + " parameters."); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

      throws ReportDataFactoryException
  {
    final ClassLoader classLoader = getClassLoader();
    if (classLoader == null)
    {
      throw new ReportDataFactoryException("No classloader!"); //$NON-NLS-1$
    }

    try
    {
      final Class c = Class.forName(className, false, classLoader);
      if (Modifier.isAbstract(c.getModifiers()))
      {
        throw new ReportDataFactoryException(
            "The specified class cannot be instantiated: it is abstract."); //$NON-NLS-1$
      }

      final Constructor[] methods = c.getConstructors();
      for (int i = 0; i < methods.length; i++)
      {
        final Constructor method = methods[i];
        if (Modifier.isPublic(method.getModifiers()) == false)
        {
          continue;
        }
        if (method.getParameterTypes().length != paramCount)
        {
          continue;
        }
        return method;
      }
    }
    catch (ClassNotFoundException e)
    {
      throw new ReportDataFactoryException("No such Class", e); //$NON-NLS-1$
    }
    throw new ReportDataFactoryException
        ("There is no constructor in class " + className + //$NON-NLS-1$
            " that accepts " + paramCount + " parameters."); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

          "that no report references illegal queries.");
      return new DefaultTableModel();
    }
    else
    {
      throw new ReportDataFactoryException("None of the data-factories was able to handle this query.");
    }
  }
View Full Code Here

   * @return the result of the query as table model.
   * @throws ReportDataFactoryException if an error occured while performing the query.
   */
  public TableModel queryData(final String query, final DataRow parameters) throws ReportDataFactoryException
  {
    throw new ReportDataFactoryException("This factory does not understand any of the queries.");
  }
View Full Code Here

        {
          return new IndexedTableModel(data);
        }
      }
    }
    throw new ReportDataFactoryException("The specified query '" + query + "' is not executable here.");
  }
View Full Code Here

  public Result performQuery(final String queryName, final DataRow parameters) throws ReportDataFactoryException
  {
    final String mdxQuery = queryMappings.get(queryName);
    if (mdxQuery == null)
    {
      throw new ReportDataFactoryException("No such query: " + queryName);
    }
    return super.performQuery(mdxQuery, parameters);
  }
View Full Code Here

      return (contentHandler.getResult());
    }
    catch (final ParserConfigurationException e)
    {
      throw new ReportDataFactoryException("Failed to init XML system", e);
    }
    catch (final SAXException e)
    {
      throw new ReportDataFactoryException("Failed to parse document", e);
    }
  }
View Full Code Here

      throw new NullPointerException("Query is null."); //$NON-NLS-1$
    }
    final String realQuery = getQuery(query);
    if (realQuery == null)
    {
      throw new ReportDataFactoryException("Query '" + query + "' is not recognized."); //$NON-NLS-1$ //$NON-NLS-2$
    }

    final TypedTableModel parameterModel = fetchParameter(parameters, realQuery);
    // name = 0
    // type = 1
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.ReportDataFactoryException

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.