Package org.apache.abdera.parser

Examples of org.apache.abdera.parser.ParseException


                    (charset == null) ? createXMLStreamReader(in) : createXMLStreamReader(in, charset);
                return parse(xmlreader, base, options);
            }
        } catch (Exception e) {
            if (!(e instanceof ParseException))
                e = new ParseException(e);
            throw (ParseException)e;
        }
    }
View Full Code Here


            }
            // return parse(StAXUtils.createXMLStreamReader(in), base, options);
            return parse(createXMLStreamReader(in), base, options);
        } catch (Exception e) {
            if (!(e instanceof ParseException))
                e = new ParseException(e);
            throw (ParseException)e;
        }
    }
View Full Code Here

        try {
            FOMBuilder builder = new FOMBuilder(getFomFactory(options), reader, options);
            return getDocument(builder, base != null ? new IRI(base) : null, options);
        } catch (Exception e) {
            if (!(e instanceof ParseException))
                e = new ParseException(e);
            throw (ParseException)e;
        }
    }
View Full Code Here

    public int next() throws OMException {
        try {
            return super.next();
        } catch (OMException e) {
            // TODO: transforming the OMException here is not ideal!
            throw new ParseException(e);
        }
    }
View Full Code Here

                        }
                        break;
                    case ENTITY_REFERENCE:
                        String val = parserOptions.resolveEntity(getLocalName());
                        if (val == null) {
                            throw new ParseException("Unresolved undeclared entity: " + getLocalName());
                        } else {
                            altEventType = CHARACTERS;
                            altText = val;
                        }
                        break;
View Full Code Here

            String slug = getSlug();
            if (slug != null)
                doc.setSlug(slug);
            return doc;
        } catch (Exception e) {
            throw new ParseException(e);
        }
    }
View Full Code Here

                if (!ignorePI) createPI();
                break;
            case XMLStreamConstants.ENTITY_REFERENCE:
                String val = parserOptions.resolveEntity(super.getName());
                if (val == null)
                  throw new ParseException("Unresolved undeclared entity: " + super.getName());
                else
                  lastNode = createOMText(val,XMLStreamConstants.CHARACTERS);
                break;
            default :
                throw new ParseException();
        }
        return token;
    } catch (ParseException e) {
        throw e;
    } catch (OMException e) {
        throw new ParseException(e);
    } catch (Exception e) {
        throw new ParseException(e);
    }
  }
View Full Code Here

      if (language != null) doc.setLanguage(language);
      String slug = getSlug();
      if (slug != null) doc.setSlug(slug);
      return doc;
    } catch (Exception e) {
      throw new ParseException(e);
    }
  }
View Full Code Here

                || (headers.containsKey(CONTENT_TYPE_HEADER) && MimeTypeHelper
                        .isAtom(headers.get(CONTENT_TYPE_HEADER)))) {
            source = getEntry(stream, request);
            entryHeaders.putAll(headers);
        } else {
            throw new ParseException("First part was not a feed or entry: "
                    + headers);
            // data = getDataInputStream(multipart);
            // dataHeaders.putAll(headers);
        }

        try {
            while (stream.available() > 0) {
                stream.skipBoundary();
                headers = getHeaders(stream);
                if (start != null
                        && (headers.containsKey(CONTENT_ID_HEADER) && start
                                .equals(headers.get(CONTENT_ID_HEADER)))
                        && (headers.containsKey(CONTENT_TYPE_HEADER) && MimeTypeHelper
                                .isAtom(headers.get(CONTENT_TYPE_HEADER)))) {
                    throw new ParseException(
                            "Should not have found a second feed or entry: "
                                    + headers);
                } else {
                    data = getDataInputStream(stream);
                    dataHeaders.putAll(headers);
View Full Code Here

        boundary = "--" + boundary;

        String type = request.getContentType().getParameter(TYPE_PARAM);
        if (!(type != null && MimeTypeHelper.isAtom(type))) {
            throw new ParseException(
                    "multipart/related stream invalid, type parameter should be "
                            + Constants.ATOM_MEDIA_TYPE);
        }

        PushbackInputStream pushBackInput = new PushbackInputStream(
View Full Code Here

TOP

Related Classes of org.apache.abdera.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.