public abstract class AbstractXmlDocumentBuilder extends DocumentBuilder
DocumentBuilder.BlockType, DocumentBuilder.SpanType
Modifier and Type | Field and Description |
---|---|
protected java.net.URI |
base |
protected boolean |
baseInHead |
protected XmlStreamWriter |
writer |
locator
Constructor and Description |
---|
AbstractXmlDocumentBuilder(java.io.Writer out) |
AbstractXmlDocumentBuilder(XmlStreamWriter writer) |
Modifier and Type | Method and Description |
---|---|
void |
characters(java.lang.String text)
Emit the given text as characters where special characters are encoded according to the output format rules.
|
protected XmlStreamWriter |
createXmlStreamWriter(java.io.Writer out) |
void |
flush()
Flushes the content of the builder.
|
java.net.URI |
getBase()
Get the base URI of the HTML document.
|
XmlStreamWriter |
getWriter()
Provides access to the underlying writer.
|
boolean |
isBaseInHead()
Indicate if the
base URI should be emitted into the <head> of the document. |
protected boolean |
isExternalLink(java.lang.String url)
indicate if the given URL is a link to an external source
|
protected java.lang.String |
makeUrlAbsolute(java.lang.String url) |
void |
setBase(java.net.URI uri)
Set the base URI of the HTML document.
|
void |
setBaseInHead(boolean baseInHead)
Indicate if the
base URI should be emitted into the <head> of the document. |
acronym, beginBlock, beginDocument, beginHeading, beginSpan, charactersUnescaped, endBlock, endDocument, endHeading, endSpan, entityReference, getLocator, horizontalRule, image, imageLink, imageLink, imageLink, lineBreak, link, link, setLocator
protected XmlStreamWriter writer
protected java.net.URI base
protected boolean baseInHead
public AbstractXmlDocumentBuilder(java.io.Writer out)
public AbstractXmlDocumentBuilder(XmlStreamWriter writer)
protected XmlStreamWriter createXmlStreamWriter(java.io.Writer out)
public XmlStreamWriter getWriter()
public void characters(java.lang.String text)
DocumentBuilder
characters
in class DocumentBuilder
text
- the text to emit.protected java.lang.String makeUrlAbsolute(java.lang.String url)
protected boolean isExternalLink(java.lang.String url)
url
- the URLpublic void flush()
DocumentBuilder
DocumentBuilder.flush()
should be called when done with a builder in cases where
DocumentBuilder.endDocument()
is not called. Calling DocumentBuilder.flush()
after DocumentBuilder.endDocument()
has no effect.
Subclasses should override to provide behaviour; the default implementation does nothing.
flush
in class DocumentBuilder
public void setBase(java.net.URI uri)
uri
- the URI, or nullpublic java.net.URI getBase()
public boolean isBaseInHead()
base URI
should be emitted into the <head> of the document. The default
value is false. Ignored unless #isEmitAsDocument()
public void setBaseInHead(boolean baseInHead)
base URI
should be emitted into the <head> of the document. The default
value is false. Ignored unless #isEmitAsDocument()
Copyright © 2007, 2013 David Green and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html