Package org.pentaho.reporting.libraries.xmlns.parser

Examples of org.pentaho.reporting.libraries.xmlns.parser.ParseException


    if ("data-definition".equals(tagName))
    {
      final String primaryFile = atts.getValue(getUri(), "ref");
      if (primaryFile == null)
      {
        throw new ParseException("Required attribute 'ref' is not specified", getLocator());
      }

      if (parseDataDefinition(primaryFile) == false)
      {
        final String fallbackFile = atts.getValue(getUri(), "local-copy");
        if (fallbackFile != null)
        {
          if (parseDataDefinition(fallbackFile) == false)
          {
            throw new ParseException("Parsing the specified local-copy failed", getLocator());
          }
        }
      }
      return new IgnoreAnyChildReadHandler();
    }
    if ("styles".equals(tagName))
    {
      final String primaryFile = atts.getValue(getUri(), "ref");
      if (primaryFile == null)
      {
        throw new ParseException("Required attribute 'ref' is not specified", getLocator());
      }

      if (parseStyles(primaryFile) == false)
      {
        final String fallbackFile = atts.getValue(getUri(), "local-copy");
        if (fallbackFile != null)
        {
          if (parseStyles(fallbackFile) == false)
          {
            throw new ParseException("Parsing the specified local-copy failed", getLocator());
          }
        }
      }
      return new IgnoreAnyChildReadHandler();
    }
    if ("layout".equals(tagName))
    {
      final String primaryFile = atts.getValue(getUri(), "ref");
      if (primaryFile == null)
      {
        throw new ParseException("Required attribute 'ref' is not specified", getLocator());
      }

      if (parseLayout(primaryFile) == false)
      {
        final String fallbackFile = atts.getValue(getUri(), "local-copy");
        if (fallbackFile != null)
        {
          if (parseLayout(fallbackFile) == false)
          {
            throw new ParseException("Parsing the specified local-copy failed", getLocator());
          }
        }
      }
      return new IgnoreAnyChildReadHandler();
    }
View Full Code Here


      logger.warn("Unable to parse the parameter for this bundle from file: " + parameterFile);
      return false;
    }
    catch (ReportDataFactoryException e)
    {
      throw new ParseException("Unable to configure datafactory.", getLocator());
    }
  }
View Full Code Here

      {
        report = (IndexElement) performExternalParsing(file, IndexElement.class, parameters);
      }
      catch (ResourceLoadingException e)
      {
        throw new ParseException("The specified subreport was not found or could not be loaded.", e);
      }
    }
    else
    {
      throw new ParseException("Required attribute 'href' is missing.", getLocator());
    }

    initialize("index");
    super.startParsing(attrs);
View Full Code Here

        getRootHandler().getDependencyCollector().add(resource);
        dataFactory = (DataFactory) resource.getResource();
      }
      catch (ResourceKeyCreationException e)
      {
        throw new ParseException("Unable to derive key for " + key + " and " + href, e, getLocator());
      }
      catch (ResourceCreationException e)
      {
        throw new ParseException("Unable to parse resource for " + key + " and " + href, e, getLocator());
      }
      catch (ResourceLoadingException e)
      {
        throw new ParseException("Unable to load resource data for " + key + " and " + href, e, getLocator());
      }
      catch (ResourceException e)
      {
        throw new ParseException("Unable to parse resource for " + key + " and " + href, e, getLocator());
      }
      return;
    }

    final String dfType = CompatibilityMapperUtil.mapClassName(attrs.getValue(getUri(), "type"));
    if (dfType != null)
    {
      final Object o = ObjectUtilities.loadAndInstantiate(dfType, getClass(), DataFactory.class);
      if (o == null)
      {
        throw new ParseException("'type' did not point to a usable DataFactory implementation.", getLocator());
      }
      dataFactory = (DataFactory) o;
    }
  }
View Full Code Here

    {
      final Object o = ObjectUtilities.loadAndInstantiate
          (CompatibilityMapperUtil.mapClassName(validatorClass), getClass(), ReportParameterValidator.class);
      if (o == null)
      {
        throw new ParseException("Valud given for 'validator' is invalid", getLocator());
      }
      parameterDefinition.setValidator((ReportParameterValidator) o);
    }
  }
View Full Code Here

    {
      body.setGroup(crosstabGroupReadHandler.getGroup());
    }
    else
    {
      throw new ParseException("Madatory element 'group' or 'crosstab' was not found.");
    }

  }
View Full Code Here

        this.expression = expression;
        this.expression.setName(name); // doesnt matter anyway, but it feels good :)
      }
      else
      {
        throw new ParseException("Required attribute 'class' is missing.",
            getRootHandler().getDocumentLocator());
      }
    }

    if (expression == null)
    {

      expression = (Expression) ObjectUtilities.loadAndInstantiate(expressionClassName, getClass(), Expression.class);
      if (expression == null)
      {
        throw new ParseException("Expression '" + expressionClassName +
            "' is not valid.", getLocator());
      }
    }
  }
View Full Code Here

      {
        report = (SubReport) performExternalParsing(file, SubReport.class, parameters);
      }
      catch (ResourceLoadingException e)
      {
        throw new ParseException("The specified subreport was not found or could not be loaded.", e);
      }
    }
    else
    {
      throw new ParseException("Required attribute 'href' is missing.", getLocator());
    }

    initialize("sub-report");
    super.startParsing(attrs);
   
View Full Code Here

    else
    {
      final String formula = atts.getValue(getUri(), "formula");
      if (formula == null)
      {
        throw new ParseException
            ("Either 'fieldname' or 'formula' attribute must be given.", getLocator());
      }
      elementFactory.setFormula(formula);
    }
  }
View Full Code Here

    {
      body.setGroup((CrosstabOtherGroup) groupOtherReadHandler.getGroup());
    }
    else
    {
      throw new ParseException("Either a 'crosstab-other-group' element must be present");
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.xmlns.parser.ParseException

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.