org.eclipse.mylyn.wikitext.core.parser.builder
Class AbstractXmlDocumentBuilder

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder
      extended by org.eclipse.mylyn.wikitext.core.parser.builder.AbstractXmlDocumentBuilder
Direct Known Subclasses:
DitaBookMapDocumentBuilder, DitaTopicDocumentBuilder, DocBookDocumentBuilder, HtmlDocumentBuilder, XslfoDocumentBuilder

public abstract class AbstractXmlDocumentBuilder
extends DocumentBuilder

Author:
David Green

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder
DocumentBuilder.BlockType, DocumentBuilder.SpanType
 
Field Summary
protected  URI base
           
protected  boolean baseInHead
           
protected  XmlStreamWriter writer
           
 
Fields inherited from class org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder
locator
 
Constructor Summary
AbstractXmlDocumentBuilder(Writer out)
           
AbstractXmlDocumentBuilder(XmlStreamWriter writer)
           
 
Method Summary
 void characters(String text)
          Emit the given text as characters where special characters are encoded according to the output format rules.
protected  XmlStreamWriter createXmlStreamWriter(Writer out)
           
 URI getBase()
          Get the base URI of the HTML document.
 int getElementNestLevel()
           
 boolean isBaseInHead()
          Indicate if the base URI should be emitted into the <head> of the document.
protected  boolean isExternalLink(String url)
          indicate if the given URL is a link to an external source
protected  String makeUrlAbsolute(String url)
           
 void setBase(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.
 
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder
acronym, annotation, beginBlock, beginDocument, beginHeading, beginLink, beginSpan, charactersUnescaped, endBlock, endDocument, endHeading, endLink, endSpan, entityReference, getLocator, image, imageLink, imageLink, imageLink, lineBreak, link, link, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

protected XmlStreamWriter writer

base

protected URI base

baseInHead

protected boolean baseInHead
Constructor Detail

AbstractXmlDocumentBuilder

public AbstractXmlDocumentBuilder(Writer out)

AbstractXmlDocumentBuilder

public AbstractXmlDocumentBuilder(XmlStreamWriter writer)
Method Detail

createXmlStreamWriter

protected XmlStreamWriter createXmlStreamWriter(Writer out)

getElementNestLevel

public int getElementNestLevel()

characters

public void characters(String text)
Description copied from class: DocumentBuilder
Emit the given text as characters where special characters are encoded according to the output format rules.

Specified by:
characters in class DocumentBuilder
Parameters:
text - the text to emit.

makeUrlAbsolute

protected String makeUrlAbsolute(String url)

isExternalLink

protected boolean isExternalLink(String url)
indicate if the given URL is a link to an external source

Parameters:
url - the URL
Returns:
true if the given URL links to an external source

setBase

public void setBase(URI uri)
Set the base URI of the HTML document. Causes all relative URLs to be prefixed with the base URI. The base URI is assumed to refer to a folder-like resource.

Parameters:
uri - the URI, or null

getBase

public URI getBase()
Get the base URI of the HTML document. A not-null value causes all relative URLs to be prefixed with the base URI. The base URI is assumed to refer to a folder-like resource.


isBaseInHead

public boolean isBaseInHead()
Indicate if the base URI should be emitted into the <head> of the document. The default value is false. Ignored unless #isEmitAsDocument()


setBaseInHead

public void setBaseInHead(boolean baseInHead)
Indicate if the base URI should be emitted into the <head> of the document. The default value is false. Ignored unless #isEmitAsDocument()



Copyright © 2011 FuseSource, Corp.. All Rights Reserved.