org.dspace.app.xmlui.wing.element
Class SimpleHTMLFragment

java.lang.Object
  extended by org.dspace.app.xmlui.wing.element.AbstractWingElement
      extended by org.dspace.app.xmlui.wing.element.SimpleHTMLFragment
All Implemented Interfaces:
WingElement

public class SimpleHTMLFragment
extends AbstractWingElement

This class represents data that is translated from simple HTML or plain text. This class represents a simple HTML fragment. It allows for user-supplied HTML to be translated on the fly into DRI. At the present time it only supports the following tags: h1, h2, h3, h4, h5, p, a, b, i, u, ol, li and img. Each are translated into their DRI equivalents, note the "h" tags are translated into a paragraph of rend=heading. If the linkbreaks flag is set then line breaks are treated as paragraphs. This allows plain text files to also be included and they will be mapped into DRI as well.

Author:
Scott Phillips, Jay Paz

Nested Class Summary
static class SimpleHTMLFragment.SAXFilter
          This is a simple SAX Handler that filters out start and end documents.
 
Field Summary
 
Fields inherited from class org.dspace.app.xmlui.wing.element.AbstractWingElement
context
 
Constructor Summary
protected SimpleHTMLFragment(WingContext context, boolean blankLines, String fragment)
          Construct a fragment object for translating into DRI.
 
Method Summary
 void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler, NamespaceSupport namespaces)
          Translate this element into SAX
 
Methods inherited from class org.dspace.app.xmlui.wing.element.AbstractWingElement
dispose, endElement, endElement, getWingContext, greater, lesser, require, require, requireFalse, requireTrue, restrict, sendCharacters, setWingContext, startElement, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHTMLFragment

protected SimpleHTMLFragment(WingContext context,
                             boolean blankLines,
                             String fragment)
                      throws WingException
Construct a fragment object for translating into DRI.

Parameters:
context - (Required) The context this element is contained in, such as where to route SAX events and what i18n catalogue to use.
blankLines - (Required) Determine if blank lines should be treated as paragraphs delimeters.
fragment - (Required) The HTML Fragment to be translated into DRI.
Throws:
WingException
Method Detail

toSAX

public void toSAX(ContentHandler contentHandler,
                  LexicalHandler lexicalHandler,
                  NamespaceSupport namespaces)
           throws SAXException
Translate this element into SAX

Parameters:
contentHandler - (Required) The registered contentHandler where SAX events should be routed too.
lexicalHandler - (Required) The registered lexicalHandler where lexical events (such as CDATA, DTD, etc) should be routed too.
namespaces - (Required) SAX Helper class to keep track of namespaces able to determine the correct prefix for a given namespace URI.
Throws:
SAXException


Copyright © 2012 DuraSpace. All Rights Reserved.