Package org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ClassFactoryCollector


  private void writeLegacyDataSource(final XmlWriter xmlWriter,
                                     final ReportWriterContext writerContext,
                                     final DataSource datasource)
      throws BundleWriterException, IOException
  {
    final ClassFactoryCollector classFactoryCollector =
        writerContext.getClassFactoryCollector();
    ObjectDescription od =
        classFactoryCollector.getDescriptionForClass(datasource.getClass());
    if (od == null)
    {
      od = classFactoryCollector.
          getSuperClassObjectDescription(datasource.getClass(), null);
    }

    if (od == null)
    {
View Full Code Here


   * @param o         the parameter value to test
   * @return true, if the default parameter description would be used, false otherwise.
   */
  private boolean isUseParameterObjectDescription(final Class parameter, final Object o)
  {
    final ClassFactoryCollector cc = getReportWriter().getClassFactoryCollector();
    ObjectDescription odObject = cc.getDescriptionForClass(o.getClass());
    ObjectDescription odParameter = cc.getDescriptionForClass(parameter);

    // search the most suitable super class object description ...
    if (odObject == null)
    {
      odObject = cc.getSuperClassObjectDescription(o.getClass(), odObject);
    }
    if (odParameter == null)
    {
      odParameter = cc.getSuperClassObjectDescription(parameter, odParameter);
    }
    return ObjectUtilities.equal(odParameter, odObject);
  }
View Full Code Here

        report.setName(value);
      }
    }
    final ElementFactoryCollector elementFactory = new ElementFactoryCollector();
    final StyleKeyFactoryCollector styleKeyFactory = new StyleKeyFactoryCollector();
    final ClassFactoryCollector classFactory = new ClassFactoryCollector();
    final DataSourceCollector dataSourceFactory = new DataSourceCollector();
    final TemplateCollector templateFactory = new TemplateCollector();

    classFactory.configure(getRootHandler().getParserConfiguration());
    dataSourceFactory.configure(getRootHandler().getParserConfiguration());
    templateFactory.configure(getRootHandler().getParserConfiguration());

    getRootHandler().setHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME, report);
    getRootHandler().setHelperObject(ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
View Full Code Here

      final StyleKeyFactoryCollector styleKeyFactory = new StyleKeyFactoryCollector();
      styleKeyFactory.addFactory(new DefaultStyleKeyFactory());
      styleKeyFactory.addFactory(new PageableLayoutStyleKeyFactory());

      final ClassFactoryCollector classFactory = new ClassFactoryCollector();
      classFactory.addFactory(new URLClassFactory());
      classFactory.addFactory(new DefaultClassFactory());
      classFactory.addFactory(new BandLayoutClassFactory());
      classFactory.addFactory(new ArrayClassFactory());

      final DataSourceCollector dataSourceFactory = new DataSourceCollector();
      dataSourceFactory.addFactory(new DefaultDataSourceFactory());

      final TemplateCollector templateFactory = new TemplateCollector();
      templateFactory.addTemplateCollection(new DefaultTemplateCollection());

      classFactory.configure(rootHandler.getParserConfiguration());
      dataSourceFactory.configure(rootHandler.getParserConfiguration());
      templateFactory.configure(rootHandler.getParserConfiguration());

      rootHandler.setHelperObject(ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
      rootHandler.setHelperObject(ReportDefinitionReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
View Full Code Here

   *
   * @return the tablemodel for the object reference generator.
   */
  public static TableModel createData()
  {
    final ClassFactoryCollector cc = new ClassFactoryCollector();
    cc.addFactory(new DefaultClassFactory());
    cc.addFactory(new DefaultDataSourceFactory());
    cc.addFactory(new TemplateClassFactory());

    return new ObjectReferenceTableModel(cc);
  }
View Full Code Here

   */
  private void writeDataSource(final DataSource datasource)
      throws IOException, ReportWriterException
  {
    final ReportWriterContext reportWriter = getReportWriter();
    final ClassFactoryCollector classFactoryCollector =
        reportWriter.getClassFactoryCollector();
    ObjectDescription od =
        classFactoryCollector.getDescriptionForClass(datasource.getClass());
    if (od == null)
    {
      od = classFactoryCollector.
          getSuperClassObjectDescription(datasource.getClass(), null);
    }

    if (od == null)
    {
View Full Code Here

    if ("org.jfree.xml.factory.objects.URLClassFactory".equals(className))
    {
      className = URLClassFactory.class.getName();
    }

    final ClassFactoryCollector fc =
        (ClassFactoryCollector) getRootHandler().getHelperObject
            (ReportDefinitionReadHandler.CLASS_FACTORY_KEY);

    final ClassFactory factory = (ClassFactory)
        ObjectUtilities.loadAndInstantiate(className, getClass(), ClassFactory.class);
    if (factory != null)
    {
      factory.configure(getRootHandler().getParserConfiguration());
      fc.addFactory(factory);
    }
  }
View Full Code Here

    this.encoding = encoding;
    this.configuration = config;

    dataSourceCollector = new DataSourceCollector();
    elementFactoryCollector = new ElementFactoryCollector();
    classFactoryCollector = new ClassFactoryCollector();
    classFactoryCollector.addFactory(dataSourceCollector);
    styleKeyFactoryCollector = new StyleKeyFactoryCollector();
    templateCollector = new TemplateCollector();

    // configure all factories with the current report configuration ...
View Full Code Here

      final StyleKeyFactoryCollector styleKeyFactory = new StyleKeyFactoryCollector();
      rootHandler.setHelperObject(ExtSubReportReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
    }
    if (rootHandler.getHelperObject(ExtSubReportReadHandler.CLASS_FACTORY_KEY) == null)
    {
      final ClassFactoryCollector classFactory = new ClassFactoryCollector();
      classFactory.configure(rootHandler.getParserConfiguration());
      rootHandler.setHelperObject(ExtSubReportReadHandler.CLASS_FACTORY_KEY, classFactory);
    }
    if (rootHandler.getHelperObject(ExtSubReportReadHandler.DATASOURCE_FACTORY_KEY) == null)
    {
      final DataSourceCollector dataSourceFactory = new DataSourceCollector();
View Full Code Here

   * @return the found object description or null, if none was found.
   */
  private ObjectDescription findObjectDescription(final StyleKey key,
                                                  final Object o)
  {
    final ClassFactoryCollector cc = getReportWriter().getClassFactoryCollector();
    // search an direct definition for the given object class ...
    ObjectDescription od = cc.getDescriptionForClass(o.getClass());
    if (od != null)
    {
      return od;
    }

    // now search an definition for the stylekey class ...
    od = cc.getDescriptionForClass(key.getValueType());

    // and use this as best known result when searching for super class object
    // descriptions. ...

    // search the most suitable super class object description for the object
    // and the key ...
    if (od == null)
    {
      od = cc.getSuperClassObjectDescription(o.getClass(), od);
    }
    if (od == null)
    {
      od = cc.getSuperClassObjectDescription(key.getValueType(), od);
    }

    // if it is still null now, then we do not know anything about this object type.
    return od;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ClassFactoryCollector

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.