info.bliki.wiki.tags
Class SourceTag

java.lang.Object
  extended by info.bliki.htmlcleaner.TagToken
      extended by info.bliki.htmlcleaner.TagNode
          extended by info.bliki.wiki.tags.HTMLTag
              extended by info.bliki.wiki.tags.SourceTag
All Implemented Interfaces:
BaseToken, IBodyTag, INoBodyParsingTag, java.lang.Cloneable

public class SourceTag
extends HTMLTag
implements INoBodyParsingTag

Allows source code to be syntax highlighted on the wiki pages. The syntax is similar to this syntax highlighting extension.


Field Summary
protected static java.lang.String SOURCE_END
           
protected static java.lang.String SOURCE_START_1
           
protected static java.lang.String SOURCE_START_2
           
 
Fields inherited from class info.bliki.wiki.tags.HTMLTag
NEW_LINES, XML_QNAME
 
Fields inherited from class info.bliki.htmlcleaner.TagNode
ALLOWED_ATTRIBUTES, ALLOWED_ATTRIBUTES_SET
 
Fields inherited from class info.bliki.htmlcleaner.TagToken
name, originalSource
 
Constructor Summary
SourceTag()
           
 
Method Summary
 java.lang.String getParents()
          Get the allowed parent tags for this tag
static java.lang.String getSourceType(java.lang.String src)
          Determine the source code type by heuristics.
 boolean isReduceTokenStack()
           
 void renderHTML(ITextConverter converter, java.lang.Appendable writer, IWikiModel model)
           
 
Methods inherited from class info.bliki.wiki.tags.HTMLTag
appendAttributes, appendEscapedAttributes, appendUnescapedAttributes, renderHTMLWithoutTag, setTemplate
 
Methods inherited from class info.bliki.htmlcleaner.TagNode
addAllowedAttribute, addAttribute, addChild, addChildren, addItemForMoving, addObjectAttribute, clone, getAllowedAttributes, getAttributes, getBodyString, getBodyString, getChildren, getItemsToMove, getObjectAttributes, getParent, isAllowedAttribute, isFormed, makeCopy, removeAllowedAttribute, serialize, setFormed, setItemsToMove, setParent
 
Methods inherited from class info.bliki.htmlcleaner.TagToken
equals, getName, getOriginalSource, hashCode, setName, setOriginalSource, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SOURCE_START_1

protected static final java.lang.String SOURCE_START_1
See Also:
Constant Field Values

SOURCE_START_2

protected static final java.lang.String SOURCE_START_2
See Also:
Constant Field Values

SOURCE_END

protected static final java.lang.String SOURCE_END
See Also:
Constant Field Values
Constructor Detail

SourceTag

public SourceTag()
Method Detail

renderHTML

public void renderHTML(ITextConverter converter,
                       java.lang.Appendable writer,
                       IWikiModel model)
                throws java.io.IOException
Overrides:
renderHTML in class HTMLTag
Throws:
java.io.IOException

isReduceTokenStack

public boolean isReduceTokenStack()
Overrides:
isReduceTokenStack in class TagToken

getParents

public java.lang.String getParents()
Description copied from class: TagToken
Get the allowed parent tags for this tag

Overrides:
getParents in class TagNode
Returns:
null if no parent tags are allowed

getSourceType

public static java.lang.String getSourceType(java.lang.String src)
Determine the source code type by heuristics. If nothing found take the xml formatter.

Parameters:
src - the source code snippet
Returns:
the source code language


Copyright © 2012 Java Wikipedia API (Bliki engine). All Rights Reserved.