Package org.apache.abdera.parser

Examples of org.apache.abdera.parser.ParseException


                        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 (options != null && options.getCharset() != null)
        ((OMDocument)document).setCharsetEncoding(options.getCharset());
      if (options != null) document.setMustPreserveWhitespace(options.getMustPreserveWhitespace());
    } catch (Exception e) {
      if (!(e instanceof ParseException))
        e = new ParseException(e);
      throw (ParseException)e;
    }
    return document;
  }
View Full Code Here

          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

          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

      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

      } else {
        return tuple;
      }
    } catch (Exception ex) {
      logger.error("error creating an entry with the row data", ex);
      throw new ParseException(ex);
    }
  }
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(request.getInputStream(), 2);
        pushBackInput.unread("\r\n".getBytes());
View Full Code Here

    }

    private void checkMultipartContent(Document<Entry> entry, Map<String, String> dataHeaders, RequestContext request)
        throws ParseException {
        if (entry == null) {
            throw new ParseException("multipart/related stream invalid, media link entry is missing");
        }
        if (!dataHeaders.containsKey(CONTENT_TYPE_HEADER)) {
            throw new ParseException("multipart/related stream invalid, data content-type is missing");
        }
        if (!isContentTypeAccepted(dataHeaders.get(CONTENT_TYPE_HEADER), request)) {
            throw new ParseException("multipart/related stream invalid, content-type " + dataHeaders
                .get(CONTENT_TYPE_HEADER)
                + " not accepted into this multipart file");
        }
    }
View Full Code Here

                ((OMDocument)document).setCharsetEncoding(options.getCharset());
            if (options != null)
                document.setMustPreserveWhitespace(options.getMustPreserveWhitespace());
        } catch (Exception e) {
            if (!(e instanceof ParseException))
                e = new ParseException(e);
            throw (ParseException)e;
        }
        return document;
    }
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.