Examples of ObjectDescription


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

  public ObjectDescription getDescriptionForClass(final Class c)
  {
    for (int i = 0; i < factories.size(); i++)
    {
      final DataSourceFactory fact = (DataSourceFactory) factories.get(i);
      final ObjectDescription o = fact.getDescriptionForClass(c);
      if (o != null)
      {
        return o.getInstance();
      }
    }
    return null;
  }
View Full Code Here

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

      (final Class d, ObjectDescription knownSuperClass)
  {
    for (int i = 0; i < factories.size(); i++)
    {
      final DataSourceFactory fact = (DataSourceFactory) factories.get(i);
      final ObjectDescription od = fact.getSuperClassObjectDescription(d, knownSuperClass);
      if (od == null)
      {
        continue;
      }
      if (knownSuperClass == null)
      {
        knownSuperClass = od;
      }
      else
      {
        if (comparator.isComparable(knownSuperClass.getObjectClass(), od.getObjectClass())
            && (comparator.compare(knownSuperClass.getObjectClass(), od.getObjectClass()) < 0))
        {
          knownSuperClass = od;
        }
      }
    }
View Full Code Here

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

    if (fc == null)
    {
      throw new NullPointerException("Class " + getClass());
    }

    ObjectDescription od = fc.getDescriptionForClass(c);
    if (od == null)
    {
      od = fc.getSuperClassObjectDescription(c, null);
      if (od == null)
      {
        return null;
      }
    }
    od.setParameter("value", value);
    return od.createObject();
  }
View Full Code Here

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

    if (c == null)
    {
      throw new NullPointerException("Class cannot be null");
    }

    final ObjectDescription directMatch = cf.getDescriptionForClass(c);
    if (directMatch != null)
    {
      return directMatch;
    }
    final ObjectDescription indirectMatch = cf.getSuperClassObjectDescription(c, null);
    if (indirectMatch != null)
    {
      return indirectMatch;
    }
    throw new ParseException
View Full Code Here

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

          getRootHandler().getDocumentLocator());
    }

    final DataSourceCollector fc = (DataSourceCollector) getRootHandler()
        .getHelperObject(ReportDefinitionReadHandler.DATASOURCE_FACTORY_KEY);
    final ObjectDescription od = fc.getDataSourceDescription(typeName);
    if (od == null)
    {
      throw new ParseException("The specified DataSource type is not defined", getLocator());
    }
    setObjectDescription(od);
View Full Code Here

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

   * @throws org.xml.sax.SAXException if there is a parsing error.
   */
  protected void doneParsing()
      throws SAXException
  {
    final ObjectDescription objectDescription = getObjectDescription();
    final Iterator basicObjectsEntries = basicObjects.entrySet().iterator();
    while (basicObjectsEntries.hasNext())
    {
      final Map.Entry entry = (Map.Entry) basicObjectsEntries.next();
      final String name = (String) entry.getKey();
      final BasicObjectReadHandler readHandler = (BasicObjectReadHandler) entry.getValue();
      objectDescription.setParameter(name, readHandler.getObject());
    }

    final Iterator compoundObjectsEntries = compoundObjects.entrySet().iterator();
    while (compoundObjectsEntries.hasNext())
    {
      final Map.Entry entry = (Map.Entry) compoundObjectsEntries.next();
      final String name = (String) entry.getKey();
      final CompoundObjectReadHandler readHandler = (CompoundObjectReadHandler) entry.getValue();
      objectDescription.setParameter(name, readHandler.getObject());
    }
  }
View Full Code Here

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

      throw new ParseException
          ("Required attribute 'name' is missing.", getLocator());
    }

    final ClassFactory fact = getClassFactory();
    final ObjectDescription currentOd = getObjectDescription();
    final Class paramDesc = currentOd.getParameterDefinition(name);
    if (paramDesc == null)
    {
      currentOd.getParameterDefinition(name);
      throw new ParseException
          ("The parameter type for '" + name + "' is not known.", getLocator());
    }
    final ObjectDescription objectDescription =
        ObjectFactoryUtility.findDescription(fact, paramDesc, getLocator());

    final BasicObjectReadHandler readHandler =
        new BasicObjectReadHandler(objectDescription);
    basicObjects.put(name, readHandler);
View Full Code Here

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

      throw new ParseException
          ("Required attribute 'name' is missing.", getLocator());
    }

    final ClassFactory fact = getClassFactory();
    final ObjectDescription currentObjDesc = getObjectDescription();
    final Class parameterDefinition =
        currentObjDesc.getParameterDefinition(name);
    if (parameterDefinition == null)
    {
      throw new ParseException("No such parameter description: " + name, getLocator());
    }
    final ObjectDescription objectDescription =
        ObjectFactoryUtility.findDescription(fact,
            parameterDefinition, getLocator());

    final CompoundObjectReadHandler readHandler =
        new CompoundObjectReadHandler(objectDescription);
View Full Code Here

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

    it = factories.iterator();

    while (it.hasNext())
    {
      final Class c = (Class) it.next();
      final ObjectDescription od = cf.getDescriptionForClass(c);
      Iterator itNames = od.getParameterNames();
      final ArrayList nameList = new ArrayList();
      while (itNames.hasNext())
      {
        nameList.add(itNames.next());
      }
      // sort the parameter names
      Collections.sort(nameList);
      itNames = nameList.iterator();
      while (itNames.hasNext())
      {
        final String name = (String) itNames.next();
        rows.add(new ObjectDescriptionRow(cf, c, name, od.getParameterDefinition(name)));
      }
    }
  }
View Full Code Here

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

  }

  public void testObjectQuery()
  {
    final DefaultClassFactory fact = new DefaultClassFactory();
    final ObjectDescription line2DDescr = fact.getDescriptionForClass(Line2D.class);
    assertNotNull(line2DDescr);
    final ObjectDescription od = fact.getSuperClassObjectDescription(Line2D.Float.class, null);
    assertEquals(line2DDescr.getClass(), od.getClass());
  }
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.