Examples of ReportDataFactoryException


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

      if (Modifier.isStatic(m.getModifiers()))
      {
        final Object data = m.invoke(null, params);
        if (data == null)
        {
          throw new ReportDataFactoryException("The call did not return a valid tablemodel.");
        }
        return (TableModel) data;
      }

      final ClassLoader classLoader = getClassLoader();
      final Class c = Class.forName(className, false, classLoader);
      final Object o = c.newInstance();
      if (o == null)
      {
        throw new ReportDataFactoryException
            ("Unable to instantiate class for non static call."); //$NON-NLS-1$
      }
      final Object data = m.invoke(o, params);
      if (data == null)
      {
        throw new ReportDataFactoryException("The call did not return a valid tablemodel.");
      }
      return (TableModel) data;
    }
    catch (ReportDataFactoryException rdfe)
    {
      throw rdfe;
    }
    catch (Exception e)
    {
      throw new ReportDataFactoryException
          ("Something went terribly wrong: ", e); //$NON-NLS-1$
    }
  }
View Full Code Here

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

Examples of org.pentaho.reporting.engine.classic.core.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("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

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

      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

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

      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

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

          "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

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

   * @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

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

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

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

  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

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

      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
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.