public OMDocument getDocument() { return (OMDocument)getFomDocument(); }
public <T extends Element> Document<T> getFomDocument() { while (!indoc && !done) { next(); } return (Document<T>)document; }
element = new FOMCategory(qname.getLocalPart(), parent, this, builder); } else if (CONTENT.equals(qname)) { Content.Type type = builder.getContentType(); if (type == null) type = Content.Type.TEXT; element = new FOMDateTime(qname.getLocalPart(), parent, this, builder); } else if (RIGHTS.equals(qname)) { Text.Type type = builder.getTextType(); if (type == null) type = Text.Type.TEXT; element = new FOMSource(qname.getLocalPart(), parent, this, builder); } else if (SUBTITLE.equals(qname)) { Text.Type type = builder.getTextType(); if (type == null) type = Text.Type.TEXT; element = new FOMText(type, qname.getLocalPart(), parent, this, builder); } else if (SUMMARY.equals(qname)) { Text.Type type = builder.getTextType(); if (type == null) type = Text.Type.TEXT; element = new FOMText(type, qname.getLocalPart(), parent, this, builder); } else if (TITLE.equals(qname)) { Text.Type type = builder.getTextType(); if (type == null) type = Text.Type.TEXT;
public <T extends Element> Document<T> parse(XMLStreamReader reader, String base, ParserOptions options) throws ParseException { 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; } }
private <T extends Element> Document<T> getDocument(FOMBuilder builder, IRI base, ParserOptions options) throws ParseException { Document<T> document = builder.getFomDocument(); try { if (base != null) document.setBaseUri(base.toString()); 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; }