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

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


      {
        final Element classElement = (Element) classNodes.item(0);
        final String className = classElement.getAttribute("instanceof"); //$NON-NLS-1$
        if (className == null)
        {
          throw new ParseException(messages.getString(
              "ConfigDescriptionModel.ERROR_0005_MISSING_INSTANCEOF")); //$NON-NLS-1$
        }
        try
        {
          final ClassLoader classLoader = ObjectUtilities.getClassLoader(getClass());
View Full Code Here


          getRootHandler().getHelperObject
              (ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY);
      final Element element = fc.getElementForType(type);
      if (element == null)
      {
        throw new ParseException("There is no factory for elements of type '" +
            type + '\'', getLocator());
      }

      final XmlReadHandler readHandler = new ElementReadHandler(element);
      elementHandlers.add(readHandler);
View Full Code Here

  {
    super.startParsing(attrs);
    groupName = attrs.getValue(getUri(), "name");
    if (groupName == null)
    {
      throw new ParseException("Mandatory attribute 'name' is missing", getLocator());
    }
  }
View Full Code Here

    int i = s.indexOf('_');
    int i2 = s.indexOf('_', i + 1);
    if (i < 0 || i2 < 0)
    {
      throw new ParseException("Invalid locale string");
    }
    return new Locale(s.substring(0, i).trim(), s.substring(i + 1, i2).trim(), s.substring(i2 + 1).trim());
  }
View Full Code Here

{
  public Object convertFromString(final String s, final Locator locator) throws ParseException
  {
    if (s == null)
    {
      throw new ParseException("s must not be null");
    }

    int i = s.indexOf(',');
    if (i < 0)
    {
      throw new ParseException("IllegalFormat");
    }
    double d1 = Double.parseDouble(s.substring(0, i).trim());
    double d2 = Double.parseDouble(s.substring(i + 1).trim());
    return new FloatDimension((float) d1, (float) d2);
  }
View Full Code Here

    {
      return s;
    }
    catch (NumberFormatException nfe)
    {
      throw new ParseException(nfe.getMessage(), locator);
    }
  }
View Full Code Here

    }

    final ObjectConverter o = (ObjectConverter) instance.converters.get(c);
    if (o == null)
    {
      throw new ParseException("Invalid type: " + c);
    }
    return o.convertFromString(s, locator);
  }
View Full Code Here

    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

    }

    int i = s.indexOf(',');
    if (i == -1)
    {
      throw new ParseException("Malformed format");
    }
    int i2 = s.indexOf(',', i + 1);
    if (i2 == -1)
    {
      throw new ParseException("Malformed format");
    }
    return new Font(s.substring(0, i).trim(),
        Integer.parseInt(s.substring(i2 + 1).trim()), Integer.parseInt(s.substring(i + 1, i2).trim()));
  }
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.