Examples of ObjectDescription


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

   * @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);
View Full Code Here

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

  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;
    }
View Full Code Here

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

   */
  private boolean isUseKeyObjectDescription
  (final StyleKey key, final Object o)
  {
    final ClassFactoryCollector cc = getReportWriter().getClassFactoryCollector();
    ObjectDescription odObject = cc.getDescriptionForClass(o.getClass());
    ObjectDescription odKey = cc.getDescriptionForClass(key.getValueType());

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

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

   * @throws ReportWriterException if there is a problem writing the report.
   */
  private void writeKeyValue(final StyleKey key, final Object o)
      throws IOException, ReportWriterException
  {
    final ObjectDescription od = findObjectDescription(key, o);
    if (od == null)
    {
      throw new ReportWriterException("Unable to find object description for key: "
          + key.getName());
    }

    try
    {
      od.setParameterFromObject(o);
    }
    catch (ObjectFactoryException e)
    {
      throw new ReportWriterException("Unable to fill the parameters for key: " + key.getName(), e);
    }
    final StyleKey keyFromFactory = getReportWriter().getStyleKeyFactoryCollector()
        .getStyleKey(key.getName());
    if (keyFromFactory == null)
    {
      throw new ReportWriterException
          ("The stylekey " + key.getName() +
              " has no corresponding key description.");
    }


    final AttributeList p = new AttributeList();
    p.setAttribute(ExtParserModule.NAMESPACE, "name", key.getName());
    if (isUseKeyObjectDescription(key, o) == false)
    {
      p.setAttribute(ExtParserModule.NAMESPACE, "class", o.getClass().getName());
    }

    final XmlWriter writer = getXmlWriter();
    final List parameterNames = getParameterNames(od);
    if (isBasicKey(parameterNames, od))
    {
      writer.writeTag(ExtParserModule.NAMESPACE, AbstractXMLDefinitionWriter.BASIC_KEY_TAG, p, XmlWriterSupport.OPEN);
      writer.writeTextNormalized((String) od.getParameter("value"), false);
      writer.writeCloseTag();
    }
    else
    {
      writer.writeTag(ExtParserModule.NAMESPACE, AbstractXMLDefinitionWriter.COMPOUND_KEY_TAG, p,
View Full Code Here

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

      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);
View Full Code Here

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

      super.writeParameter(name);
      return;
    }

    final DataSource ds = (DataSource) getObjectDescription().getParameter(name);
    final ObjectDescription dsDesc = getParameterDescription(name);
    final String dsname = dataSourceCollector.getDataSourceName(dsDesc);

    if (dsname == null)
    {
      throw new ReportWriterException("The datasource type is not registered: "
View Full Code Here

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

                                     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);
View Full Code Here

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

   * @param name the data source name.
   * @return The object description.
   */
  public ObjectDescription getDataSourceDescription(final String name)
  {
    final ObjectDescription od = (ObjectDescription) dataSources.get(name);
    if (od != null)
    {
      return od.getInstance();
    }
    return null;
  }
View Full Code Here

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

  {
    final Iterator keys = dataSources.keySet().iterator();
    while (keys.hasNext())
    {
      final String key = (String) keys.next();
      final ObjectDescription ds = (ObjectDescription) dataSources.get(key);
      if (ds.getObjectClass().equals(od.getObjectClass()))
      {
        return key;
      }
    }
    return null;
View Full Code Here

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

  public ObjectDescription getDataSourceDescription(final String name)
  {
    for (int i = 0; i < factories.size(); i++)
    {
      final DataSourceFactory fact = (DataSourceFactory) factories.get(i);
      final ObjectDescription o = fact.getDataSourceDescription(name);
      if (o != null)
      {
        return o.getInstance();
      }
    }
    return null;
  }
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.