|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.bliki.wiki.model.AbstractWikiModel
public abstract class AbstractWikiModel
Standard model implementation for the Wikipedia syntax
Field Summary | |
---|---|
protected java.util.Map<java.lang.Class,java.lang.Object> |
attributeRenderers
A Map |
protected java.util.Map<java.lang.String,java.lang.Object> |
attributes
Map an attribute name to its value(s). |
protected INamespace |
fNamespace
|
protected java.lang.String |
fPageTitle
|
protected int |
fParserRecursionCount
|
protected int |
fRecursionLevel
|
protected java.lang.String |
fRedirectLink
|
protected java.util.Map<java.lang.String,java.lang.Integer> |
fReferenceNames
|
protected java.util.ArrayList<Reference> |
fReferences
|
protected int |
fSectionCounter
|
protected java.util.List<java.lang.Object> |
fTableOfContent
"table of content" |
protected TableOfContentTag |
fTableOfContentTag
A tag that manages the "table of content" |
protected TagStack |
fTagStack
|
protected int |
fTemplateRecursionCount
|
protected java.util.HashSet<java.lang.String> |
fToCSet
Contains all anchor strings to create unique anchors |
Constructor Summary | |
---|---|
AbstractWikiModel()
|
|
AbstractWikiModel(Configuration configuration)
|
|
AbstractWikiModel(Configuration configuration,
java.util.Locale locale)
|
|
AbstractWikiModel(Configuration configuration,
java.util.Locale locale,
java.util.ResourceBundle resourceBundle,
INamespace namespace)
|
|
AbstractWikiModel(Configuration configuration,
java.util.ResourceBundle resourceBundle,
INamespace namespace)
Deprecated. use the (Configuration configuration, Locale locale,...)
constructors instead. |
Method Summary | |
---|---|
void |
addCategory(java.lang.String categoryName,
java.lang.String sortKey)
When an article contains a token indicating that the article belongs to a specific category this method should be called to add that category to the output metadata. |
SourceCodeFormatter |
addCodeFormatter(java.lang.String key,
SourceCodeFormatter value)
Add a new source code formatter to the configuration |
java.lang.String |
addInterwikiLink(java.lang.String key,
java.lang.String value)
Add another Interwiki link to the configuration. |
void |
addLink(java.lang.String topicName)
When a document contains a token indicating that the document links to another Wiki topic this method should be called to add that topic link to the output metadata. |
boolean |
addSemanticAttribute(java.lang.String attribute,
java.lang.String attributeValue)
See Semantic MediaWiki for more information. |
boolean |
addSemanticRelation(java.lang.String relation,
java.lang.String relationValue)
See Semantic MediaWiki for more information. |
void |
addTemplate(java.lang.String template)
When a document contains a token indicating that the document includes a Wiki template this method should be called to add that template to the output metadata. |
ITemplateFunction |
addTemplateFunction(java.lang.String key,
ITemplateFunction value)
Add a new interwiki link to the configuration |
TagToken |
addTokenTag(java.lang.String key,
TagToken value)
Add a new HTML styled tag to the configuration |
java.lang.String[] |
addToReferences(java.lang.String reference,
java.lang.String nameAttribute)
Add a reference (i.e. footnote) to the internal list |
protected void |
addToTableOfContent(java.util.List<java.lang.Object> toc,
SectionHeader strPair,
int headLevel)
Add a section header with the given headLevel to the
"table of content" |
void |
append(BaseToken contentNode)
Append the content as a child on the top node of the internal stack |
void |
appendExternalImageLink(java.lang.String imageSrc,
java.lang.String imageAltText)
Append an external wiki image link (starting with http, https,... and ending with gif, png, jpg, bmp) |
void |
appendExternalLink(java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
Deprecated. use IWikiModel.appendExternalLink(String, String, String, boolean)
instead. |
void |
appendExternalLink(java.lang.String uriSchemeName,
java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
Append an external link (starting with http, https, ftp,...) as described in Help Links |
ITableOfContent |
appendHead(java.lang.String rawHead,
int headLevel,
boolean noToC,
int headCounter)
Add a single wiki head (i.e. ==...==, ===...===, ====...====,...) to the table of content |
ITableOfContent |
appendHead(java.lang.String rawHead,
int headLevel,
boolean noToC,
int headCounter,
int startPosition,
int endPosition)
Append a new head to the table of content |
void |
appendInternalImageLink(java.lang.String hrefImageLink,
java.lang.String srcImageLink,
ImageFormat imageFormat)
Append this internal wiki image link. |
void |
appendInternalLink(java.lang.String topic,
java.lang.String hashSection,
java.lang.String topicDescription,
java.lang.String cssClass,
boolean parseRecursive)
Append an internal wikilink as described in Help Links |
void |
appendInterWikiLink(java.lang.String namespace,
java.lang.String title,
java.lang.String linkText)
Append an InterWiki link |
void |
appendISBNLink(java.lang.String isbnPureText)
Append an external ISBN link (starting with ISBN ) as
described in Wikipedia:ISBN
Note: The default implementation in the AbstractWikiModel class creates a link to Amazon.com. |
void |
appendMailtoLink(java.lang.String link,
java.lang.String linkName,
boolean withoutSquareBrackets)
Append an external link (starting with mailto:...) as described in Help:Wikitext#Links |
boolean |
appendRawNamespaceLinks(java.lang.String rawNamespaceTopic,
java.lang.String viewableLinkDescription,
boolean containsNoPipe)
Check if the topic is a special namespace topic. |
void |
appendRawWikipediaLink(java.lang.String rawLinkText,
java.lang.String suffix)
Main entry method for parsing a raw wiki link (i.e. the text between the [[...]] square brackets). |
boolean |
appendRedirectLink(java.lang.String redirectLink)
Append the redirect link to the model |
void |
appendSignature(java.lang.Appendable writer,
int numberOfTildes)
Append the user signature to the writer (i.e. '~~~', '~~~~' or '~~~~'). |
void |
appendStack(TagStack stack)
Append the given tag stack to the current tag stack of the model. |
TagNode |
appendToCAnchor(java.lang.String anchor)
|
void |
buildEditLinkUrl(int section)
Build the link to edit a section of the wikipedia article |
AbstractParser |
createNewInstance(java.lang.String rawWikitext)
Create a new parser instance |
ITableOfContent |
createTableOfContent(boolean isTOCIdentifier)
Create the "table of content" placeholder |
int |
decrementRecursionLevel()
Decrement the current recursion level of the parser. |
java.lang.String |
encodeTitleDotUrl(java.lang.String wikiTitle,
boolean firstCharacterAsUpperCase)
Encode the wiki links title into a URL for HTML hyperlinks (i.e. |
java.lang.String |
encodeTitleToUrl(java.lang.String wikiTitle,
boolean firstCharacterAsUpperCase)
Encode the wiki links title into a URL for HTML hyperlinks (i.e. |
java.lang.String |
get2ndCategoryNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for categories in this wiki |
java.lang.String |
get2ndImageNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for images in this wiki |
java.lang.String |
get2ndTemplateNamespace()
Get the secondary namespace (i.e. the namespace for a non-englich locale) for templates in this wiki |
java.lang.Object |
getAttribute(java.lang.String attribute)
Resolve an attribute reference. |
AttributeRenderer |
getAttributeRenderer(java.lang.Class attributeClassType)
What renderer is registered for this attributeClassType for this template. |
java.lang.String |
getCategoryNamespace()
Get the primary namespace for categories in this wiki |
java.util.Map<java.lang.String,SourceCodeFormatter> |
getCodeFormatterMap()
Get the source code formatter map of built-in source code formatters |
java.util.Date |
getCurrentTimeStamp()
Get the current time stamp. |
java.lang.String |
getImageNamespace()
Get the primary namespace for images in this wiki |
java.util.Map<java.lang.String,java.lang.String> |
getInterwikiMap()
Get the interwiki links map for converting interwiki links into external URLs. |
java.util.Locale |
getLocale()
Get the locale of this model. |
int |
getNextNumber()
Get the next unique number |
TagToken |
getNode(int offset)
Get the node at the given offset on the internal stack For example getNode(fWikiModel.stackSize() - 2) returns the node before
the node at top of the stack. |
java.lang.String |
getPageName()
Get the title of the current wiki article. |
java.lang.String |
getRawWikiContent(java.lang.String namespace,
java.lang.String templateName,
java.util.Map<java.lang.String,java.lang.String> templateParameters)
Get the raw wiki text for the given namespace and article name |
int |
getRecursionLevel()
Get the current recursion level of the parser. |
java.lang.String |
getRedirectLink()
Get the redirect link. |
java.util.List<Reference> |
getReferences()
Get the internal list of references (i.e. footnotes) |
java.util.ResourceBundle |
getResourceBundle()
Get the resource bundle associated with this model for I18N support |
java.util.List<SemanticAttribute> |
getSemanticAttributes()
Get the list of SemanticAttributes |
java.util.List<SemanticRelation> |
getSemanticRelations()
Get the list of SemanticRelations. |
ITableOfContent |
getTableOfContent()
Get the parsed "table of content" data after parsing the Wikipedia text. |
java.util.Map<java.lang.String,java.lang.String> |
getTemplateCallsCache()
Get the currently configured cache implementation for template calls. |
ITemplateFunction |
getTemplateFunction(java.lang.String name)
Get a template parser function (i.e. |
java.util.Map<java.lang.String,ITemplateFunction> |
getTemplateMap()
Get the template parser functions map of built-in template functions |
java.lang.String |
getTemplateNamespace()
Get the primary namespace for templates in this wiki model |
java.util.Map<java.lang.String,TagToken> |
getTokenMap()
Get the HTML styled tag map for built-in tags |
java.util.Set<java.lang.String> |
getUriSchemeSet()
Get the set of all allowed URI scheme shortcuts like http, https, ftp,... |
IEventListener |
getWikiListener()
Get the current defined wiki listener |
int |
incrementParserRecursionCount()
|
int |
incrementRecursionLevel()
Increment the current recursion level of the parser. |
int |
incrementTemplateRecursionCount()
|
protected void |
initialize()
Initialize the internal class attributes |
boolean |
isCamelCaseEnabled()
Checks if CamelCase words should also be used as wiki links. |
boolean |
isCategoryNamespace(java.lang.String namespace)
Check if the given namespace is a category namespace |
boolean |
isEditorMode()
The current model is used to render a wikipage in editor mode |
boolean |
isImageNamespace(java.lang.String namespace)
Check if the given namespace is an image namespace |
boolean |
isInterWiki(java.lang.String namespace)
Check if the given namespace is an interwiki link prefix. |
boolean |
isMathtranRenderer()
If the <math> tag should be rendered for the www.mathtran.org service, then return
true . |
boolean |
isNamespace(java.lang.String namespace)
Check if the given namespace is a namespace in this model |
boolean |
isPreviewMode()
The current model is used to render a wikipage in preview mode |
boolean |
isSemanticWebActive()
Allow the parsing of semantic mediawiki (SMW) links. |
boolean |
isTemplateNamespace(java.lang.String namespace)
Check if the given namespace is a template namespace |
boolean |
isTemplateTopic()
Determine if the currently parsed wiki text is a template. |
boolean |
isValidUriScheme(java.lang.String uriScheme)
Check if the top level URI (Uniform Resource Identifier) scheme name is valid in this model. |
boolean |
isValidUriSchemeSpecificPart(java.lang.String uriScheme,
java.lang.String uriSchemeSpecificPart)
Check if the scheme-specific part for a given top level URI (Uniform Resource Identifier) scheme name is valid in this model. |
boolean |
parseBBCodes()
Parse BBCode (Bulletin Board Code), like syntax codes in this wiki. |
void |
parseEvents(IEventListener listener,
java.lang.String rawWikiText)
Parse the raw Wikipedia text and notify the listener |
java.lang.String |
parseTemplates(java.lang.String rawWikiText)
Parse the templates in a raw wikipedia text into a resulting wikipedia text. |
java.lang.String |
parseTemplates(java.lang.String rawWikiText,
boolean parseOnlySignature)
Parse the templates in a raw wikipedia text into a resulting wikipedia text. |
TagToken |
peekNode()
Get the current TagNode on top of the internal stack |
TagToken |
popNode()
Pop the current TagNode from top of the internal stack |
boolean |
pushNode(TagToken node)
Push the given TagNode on top of the internal stack |
protected void |
rawSetAttribute(java.util.Map attributes,
java.lang.String name,
java.lang.Object value)
Map a value to a named attribute. |
void |
registerRenderer(java.lang.Class attributeClassType,
AttributeRenderer renderer)
Register a renderer for all objects of a particular type. |
java.lang.String |
render(ITextConverter converter,
java.lang.String rawWikiText)
Render the raw Wikipedia text into a string for a given converter |
java.lang.String |
render(java.lang.String rawWikiText)
Render the raw Wikipedia text into an HTML string and use the default HTMLConverter |
java.lang.String |
renderPDF(java.lang.String rawWikiText)
Render the raw Wikipedia text into an HTML string and use the default PDFConverter. |
boolean |
replaceColon()
Replace a colon ':' with a slash '/' in wiki names (i.e. links, categories, templates) |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set an attribute for this template. |
void |
setAttributeRenderers(java.util.Map renderers)
Specify a complete map of what object classes should map to which renderer objects. |
protected void |
setDefaultThumbWidth(ImageFormat imageFormat)
Set the default thumb format width. |
void |
setPageName(java.lang.String pageTitle)
Set the title of the currently rendered page data. |
void |
setSemanticWebActive(boolean semanticWeb)
Activate the parsing of semantic Mediawiki (SMW) links See Semantic MediaWiki for more information. |
void |
setTemplateCallsCache(java.util.Map<java.lang.String,java.lang.String> map)
Set a cache map implementation. |
void |
setUp()
Prepare or initialize the wiki model before rendering the wikipedia text |
boolean |
showSyntax(java.lang.String tagName)
Show the syntax highlighting of the source code |
int |
stackSize()
The size of the internal stack |
void |
substituteTemplateCall(java.lang.String templateName,
java.util.Map<java.lang.String,java.lang.String> parameterMap,
java.lang.Appendable writer)
Substitute the template name by the template content and parameters and append the new content to the writer. |
TagStack |
swapStack(TagStack stack)
|
void |
tearDown()
Clean up (i.e. free internal resources) in the wiki model after rendering the wikipedia text, if necessary |
java.util.List<BaseToken> |
toNodeList(java.lang.String rawWikiText)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface info.bliki.wiki.model.IWikiModel |
---|
getLinks, getNamespace, parseInternalImageLink |
Field Detail |
---|
protected java.util.ArrayList<Reference> fReferences
protected java.util.Map<java.lang.String,java.lang.Integer> fReferenceNames
protected int fRecursionLevel
protected int fParserRecursionCount
protected int fTemplateRecursionCount
protected TagStack fTagStack
protected INamespace fNamespace
protected java.lang.String fRedirectLink
protected java.lang.String fPageTitle
protected int fSectionCounter
protected TableOfContentTag fTableOfContentTag
protected java.util.List<java.lang.Object> fTableOfContent
protected java.util.HashSet<java.lang.String> fToCSet
protected java.util.Map<java.lang.String,java.lang.Object> attributes
protected java.util.Map<java.lang.Class,java.lang.Object> attributeRenderers
Constructor Detail |
---|
public AbstractWikiModel()
public AbstractWikiModel(Configuration configuration)
public AbstractWikiModel(Configuration configuration, java.util.Locale locale)
public AbstractWikiModel(Configuration configuration, java.util.ResourceBundle resourceBundle, INamespace namespace)
(Configuration configuration, Locale locale,...)
constructors instead.
configuration
- resourceBundle
- namespace
- public AbstractWikiModel(Configuration configuration, java.util.Locale locale, java.util.ResourceBundle resourceBundle, INamespace namespace)
Method Detail |
---|
public void addCategory(java.lang.String categoryName, java.lang.String sortKey)
sortKey
see also Wikipedia:Categorization#Category_sorting
addCategory
in interface IWikiModel
categoryName
- The name of the category that the document belongs to.sortKey
- The sort key for the category, or null
if no sort key
has been specified. The sort key determines what order categories
are sorted on category index pages, so a category for "John Doe"
might be given a sort key of "Doe, John".public SourceCodeFormatter addCodeFormatter(java.lang.String key, SourceCodeFormatter value)
addCodeFormatter
in interface IConfiguration
public java.lang.String addInterwikiLink(java.lang.String key, java.lang.String value)
${title}
placeholder for the used wiki article
link.
addInterwikiLink
in interface IConfiguration
key
- the prefix used in the interwiki link (i.e. [[prefix:...]] )value
- the external link which should be generated from the interwiki
link
public void addLink(java.lang.String topicName)
addLink
in interface IWikiModel
topicName
- The name of the topic that is linked to.public boolean addSemanticAttribute(java.lang.String attribute, java.lang.String attributeValue)
addSemanticAttribute
in interface IWikiModel
public boolean addSemanticRelation(java.lang.String relation, java.lang.String relationValue)
addSemanticRelation
in interface IWikiModel
public void addTemplate(java.lang.String template)
addTemplate
in interface IWikiModel
template
- The name of the template that is being included.public ITemplateFunction addTemplateFunction(java.lang.String key, ITemplateFunction value)
addTemplateFunction
in interface IConfiguration
public TagToken addTokenTag(java.lang.String key, TagToken value)
addTokenTag
in interface IConfiguration
public java.lang.String[] addToReferences(java.lang.String reference, java.lang.String nameAttribute)
addToReferences
in interface IWikiModel
reference
- the rendered HTML code of the ref-Tag bodynameAttribute
- the value of the name
attribute or null
protected void addToTableOfContent(java.util.List<java.lang.Object> toc, SectionHeader strPair, int headLevel)
headLevel
to the
"table of content"
toc
- the "table of content list"strPair
- a new section headerheadLevel
- the level of the new section headerpublic void append(BaseToken contentNode)
append
in interface IWikiModel
public void appendExternalImageLink(java.lang.String imageSrc, java.lang.String imageAltText)
appendExternalImageLink
in interface IWikiModel
@Deprecated public void appendExternalLink(java.lang.String link, java.lang.String linkName, boolean withoutSquareBrackets)
IWikiModel.appendExternalLink(String, String, String, boolean)
instead.
appendExternalLink
in interface IWikiModel
link
- the external link with http://, https:// or ftp://
prefixlinkName
- the link name which is separated from the URL by a spacewithoutSquareBrackets
- if true
a link with no square brackets around the
link was parsedpublic void appendExternalLink(java.lang.String uriSchemeName, java.lang.String link, java.lang.String linkName, boolean withoutSquareBrackets)
appendExternalLink
in interface IWikiModel
uriSchemeName
- the top level URI (Uniform Resource Identifier) scheme name
(without the following colon character ":"). Example "ftp",
"http", "https". See URI schemelink
- the external link with http://, https:// or ftp://
prefixlinkName
- the link name which is separated from the URL by a spacewithoutSquareBrackets
- if true
a link with no square brackets around the
link was parsedpublic ITableOfContent appendHead(java.lang.String rawHead, int headLevel, boolean noToC, int headCounter)
appendHead
in interface IWikiModel
rawHead
- the unparsed header stringheadLevel
- level of header (i.e. h1, h2, h3, h4, 5h,..)headCounter
- the total number of headers parsed
public ITableOfContent appendHead(java.lang.String rawHead, int headLevel, boolean noToC, int headCounter, int startPosition, int endPosition)
appendHead
in interface IWikiModel
rawHead
- headLevel
- headCounter
- the total number of headers parsedstartPosition
- the start index in the text where the header line of the section
beginsendPosition
- the start index in the text where the header line of the section
ends
public void appendInternalImageLink(java.lang.String hrefImageLink, java.lang.String srcImageLink, ImageFormat imageFormat)
HTMLConverter#imageNodeToText()
method.
appendInternalImageLink
in interface IWikiModel
protected void setDefaultThumbWidth(ImageFormat imageFormat)
imageFormat
- public void appendInternalLink(java.lang.String topic, java.lang.String hashSection, java.lang.String topicDescription, java.lang.String cssClass, boolean parseRecursive)
appendInternalLink
in interface IWikiModel
cssClass
- the links CSS class styleparseRecursive
- TODOpublic void appendInterWikiLink(java.lang.String namespace, java.lang.String title, java.lang.String linkText)
appendInterWikiLink
in interface IWikiModel
public void appendISBNLink(java.lang.String isbnPureText)
ISBN
) as
described in Wikipedia:ISBN
AbstractWikiModel
class creates a link to Amazon.com.
appendISBNLink
in interface IWikiModel
isbnPureText
- the pure ISBN string which contains the ISBN prefix and optional
dashes in the ISBN numberpublic void appendMailtoLink(java.lang.String link, java.lang.String linkName, boolean withoutSquareBrackets)
appendMailtoLink
in interface IWikiModel
link
- the external link with mailto:
prefixlinkName
- the link name which is separated from the URL by a spacewithoutSquareBrackets
- if true
a mailto link with no square brackets around
the link was parsedpublic boolean appendRawNamespaceLinks(java.lang.String rawNamespaceTopic, java.lang.String viewableLinkDescription, boolean containsNoPipe)
AbstractWikiModel
defaults implementation this namespace topic
is parsed and checks for various namespaces, like Categories
and Interwiki
links.
appendRawNamespaceLinks
in interface IWikiModel
rawNamespaceTopic
- the text between the [[...]] square brackets of a wiki link before
the pipe symbolcontainsNoPipe
- set to true
if the rawLinkText contained no pipe
symbol.
true
if the topic is a special namespace topicpublic void appendRawWikipediaLink(java.lang.String rawLinkText, java.lang.String suffix)
AbstractWikiModel
defaults
implementation this link is parsed and the various other
append...
methods of the model are called for the different
cases.
appendRawWikipediaLink
in interface IWikiModel
rawLinkText
- the text between the [[...]] square brackets of a wiki linksuffix
- a String of lowercase letters which directly follow the link after
the closing ]] brackets. Useful for topic plurals.public boolean appendRedirectLink(java.lang.String redirectLink)
appendRedirectLink
in interface IWikiModel
redirectLink
- the raw string between the wikilink tags [[ ]]
true
if the the wikitext shouldn't be parsedpublic void appendSignature(java.lang.Appendable writer, int numberOfTildes) throws java.io.IOException
appendSignature
in interface IWikiModel
numberOfTildes
- an int
value between 3 and 5
java.io.IOException
public void appendStack(TagStack stack)
appendStack
in interface IWikiModel
public TagNode appendToCAnchor(java.lang.String anchor)
public void buildEditLinkUrl(int section)
buildEditLinkUrl
in interface IWikiModel
public AbstractParser createNewInstance(java.lang.String rawWikitext)
createNewInstance
in interface IWikiModel
public ITableOfContent createTableOfContent(boolean isTOCIdentifier)
IWikiModel
createTableOfContent
in interface IWikiModel
isTOCIdentifier
- true
if the __TOC__ keyword was parsed
public int decrementRecursionLevel()
decrementRecursionLevel
in interface IWikiModel
public java.lang.String encodeTitleDotUrl(java.lang.String wikiTitle, boolean firstCharacterAsUpperCase)
firstCharacterAsUpperCase
parameters must be set to true
. For an example encoding
routine see:
Encoder.encodeTitleDotUrl(String, boolean)
encodeTitleDotUrl
in interface IWikiModel
firstCharacterAsUpperCase
- if true
convert the first of the title to uppercaseEncoder.encodeTitleToUrl(String, boolean)
public java.lang.String encodeTitleToUrl(java.lang.String wikiTitle, boolean firstCharacterAsUpperCase)
firstCharacterAsUpperCase
parameters must be set to true
. For an example encoding
routine see
Encoder.encodeTitleToUrl(String, boolean)
encodeTitleToUrl
in interface IWikiModel
firstCharacterAsUpperCase
- if true
convert the first of the title to uppercaseEncoder.encodeTitleToUrl(String, boolean)
public java.lang.String get2ndCategoryNamespace()
get2ndCategoryNamespace
in interface IWikiModel
public java.lang.String get2ndImageNamespace()
get2ndImageNamespace
in interface IWikiModel
public java.lang.String get2ndTemplateNamespace()
get2ndTemplateNamespace
in interface IWikiModel
public java.lang.Object getAttribute(java.lang.String attribute)
getAttribute
in interface IContext
public AttributeRenderer getAttributeRenderer(java.lang.Class attributeClassType)
getAttributeRenderer
in interface IContext
public java.lang.String getCategoryNamespace()
getCategoryNamespace
in interface IWikiModel
public java.util.Map<java.lang.String,SourceCodeFormatter> getCodeFormatterMap()
getCodeFormatterMap
in interface IConfiguration
public java.util.Date getCurrentTimeStamp()
new Date(System.currentTimeMillis());
.
getCurrentTimeStamp
in interface IWikiModel
public java.lang.String getImageNamespace()
getImageNamespace
in interface IWikiModel
public java.util.Map<java.lang.String,java.lang.String> getInterwikiMap()
getInterwikiMap
in interface IConfiguration
public java.util.Locale getLocale()
getLocale
in interface IWikiModel
public int getNextNumber()
getNextNumber
in interface IWikiModel
int
number.public TagToken getNode(int offset)
getNode(fWikiModel.stackSize() - 2)
returns the node before
the node at top of the stack.
getNode
in interface IWikiModel
public java.lang.String getPageName()
getPageName
in interface IWikiModel
public java.lang.String getRawWikiContent(java.lang.String namespace, java.lang.String templateName, java.util.Map<java.lang.String,java.lang.String> templateParameters)
getRawWikiContent
in interface IWikiModel
namespace
- the namespace of this articletemplateName
- the name of the templatetemplateParameters
- if the namespace is the Template namespace, the current
template parameters are stored as String
s in this map
null
if no content was foundpublic int getRecursionLevel()
getRecursionLevel
in interface IWikiModel
public java.lang.String getRedirectLink()
getRedirectLink
in interface IWikiModel
[[ ]]
or
null
if no redirect existspublic java.util.List<Reference> getReferences()
getReferences
in interface IWikiModel
null
if no reference existsReference
public java.util.ResourceBundle getResourceBundle()
getResourceBundle
in interface IWikiModel
public java.util.List<SemanticAttribute> getSemanticAttributes()
getSemanticAttributes
in interface IWikiModel
null
if no
SemanticAttribute existspublic java.util.List<SemanticRelation> getSemanticRelations()
getSemanticRelations
in interface IWikiModel
null
if no
SemanticRelation existspublic ITableOfContent getTableOfContent()
getTableOfContent
in interface IWikiModel
public java.util.Map<java.lang.String,java.lang.String> getTemplateCallsCache()
getTemplateCallsCache
in interface IConfiguration
null
if no cache implementation is set.IConfiguration.setTemplateCallsCache(Map)
public ITemplateFunction getTemplateFunction(java.lang.String name)
{{ #if: ... }}
)
implementation.
getTemplateFunction
in interface IWikiModel
name
- the name of the function without the "#" and
":" delimiters
null
if no function is
available for the given namepublic java.util.Map<java.lang.String,ITemplateFunction> getTemplateMap()
getTemplateMap
in interface IConfiguration
public java.lang.String getTemplateNamespace()
getTemplateNamespace
in interface IWikiModel
public java.util.Map<java.lang.String,TagToken> getTokenMap()
getTokenMap
in interface IConfiguration
public java.util.Set<java.lang.String> getUriSchemeSet()
getUriSchemeSet
in interface IConfiguration
public IEventListener getWikiListener()
getWikiListener
in interface IWikiModel
null
if no listener is definedpublic int incrementParserRecursionCount()
incrementParserRecursionCount
in interface IWikiModel
public int incrementRecursionLevel()
incrementRecursionLevel
in interface IWikiModel
public int incrementTemplateRecursionCount()
incrementTemplateRecursionCount
in interface IWikiModel
protected void initialize()
public boolean isCamelCaseEnabled()
isCamelCaseEnabled
in interface IWikiModel
true
if CamelCase words should also be used as wiki
linkspublic boolean isCategoryNamespace(java.lang.String namespace)
isCategoryNamespace
in interface IWikiModel
true
if the namespace is a category namespace.public boolean isEditorMode()
isEditorMode
in interface IWikiModel
true
if your model is used in an editor modepublic boolean isImageNamespace(java.lang.String namespace)
isImageNamespace
in interface IWikiModel
true
if the namespace is a image namespace.public boolean isInterWiki(java.lang.String namespace)
isInterWiki
in interface IWikiModel
true
if the namespace is a interwiki namespace (i.e.
prefix).public boolean isMathtranRenderer()
<math>
tag should be rendered for the www.mathtran.org service, then return
true
.
isMathtranRenderer
in interface IWikiModel
true
the <math>
tag should be
rendered fro mathtran.org.public boolean isNamespace(java.lang.String namespace)
isNamespace
in interface IWikiModel
true
if the namespace is a namespace in this modelpublic boolean isPreviewMode()
isPreviewMode
in interface IWikiModel
true
if your model is used in a preview modepublic boolean isSemanticWebActive()
isSemanticWebActive
in interface IWikiModel
true
if parsing of semantic mediawiki (SMW) links is
enabledpublic boolean isTemplateNamespace(java.lang.String namespace)
isTemplateNamespace
in interface IWikiModel
true
if the namespace is a template namespace.public boolean isTemplateTopic()
isTemplateTopic
in interface IWikiModel
true
if the currently parsed wiki text is a templatepublic boolean isValidUriScheme(java.lang.String uriScheme)
isValidUriScheme
in interface IWikiModel
uriScheme
- the top level URI (Uniform Resource Identifier) scheme name
(without the following colon character ":")
true
if the specified URI scheme is valid.IWikiModel.isValidUriSchemeSpecificPart(String, String)
public boolean isValidUriSchemeSpecificPart(java.lang.String uriScheme, java.lang.String uriSchemeSpecificPart)
isValidUriSchemeSpecificPart
in interface IWikiModel
uriScheme
- the top level URI (Uniform Resource Identifier) scheme name
(without the following colon character ":")uriSchemeSpecificPart
- the URI (Uniform Resource Identifier) scheme part following the
top level scheme name and the colon character ":"
true
if the specified URI scheme is valid.IWikiModel.isValidUriScheme(String)
public boolean parseBBCodes()
parseBBCodes
in interface IWikiModel
true
if the bbCodes should be parsedpublic void parseEvents(IEventListener listener, java.lang.String rawWikiText)
parseEvents
in interface IWikiModel
listener
- an event listenerrawWikiText
- the raw wiki textpublic java.lang.String parseTemplates(java.lang.String rawWikiText)
parseTemplates
in interface IWikiModel
public java.lang.String parseTemplates(java.lang.String rawWikiText, boolean parseOnlySignature)
parseTemplates
in interface IWikiModel
parseOnlySignature
- if true
parse only the signature wiki texts, no
templates and wiki comment parsing
public TagToken peekNode()
peekNode
in interface IWikiModel
public TagToken popNode()
popNode
in interface IWikiModel
public boolean pushNode(TagToken node)
pushNode
in interface IWikiModel
true
if the push on the internal stack was successfulprotected void rawSetAttribute(java.util.Map attributes, java.lang.String name, java.lang.Object value)
public void registerRenderer(java.lang.Class attributeClassType, AttributeRenderer renderer)
registerRenderer
in interface IContext
public java.lang.String render(ITextConverter converter, java.lang.String rawWikiText)
render
in interface IWikiModel
converter
- a text converter. Note the converter may be
null
, if you only would like to analyze the raw wiki
text and don't need to convert. This speeds up the parsing
process.rawWikiText
- a raw wiki text
null
if an IOException occurs or
converter==null
public java.lang.String render(java.lang.String rawWikiText)
render
in interface IWikiModel
null
if an IOException occurspublic java.lang.String renderPDF(java.lang.String rawWikiText)
renderPDF
in interface IWikiModel
null
if an IOException occurspublic boolean replaceColon()
replaceColon
in interface IWikiModel
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface IContext
public void setAttributeRenderers(java.util.Map renderers)
public void setPageName(java.lang.String pageTitle)
setPageName
in interface IWikiModel
public void setSemanticWebActive(boolean semanticWeb)
setSemanticWebActive
in interface IWikiModel
public void setTemplateCallsCache(java.util.Map<java.lang.String,java.lang.String> map)
setTemplateCallsCache
in interface IConfiguration
map
- the cache implementationpublic void setUp()
setUp
in interface IWikiModel
public boolean showSyntax(java.lang.String tagName)
showSyntax
in interface IWikiModel
public int stackSize()
stackSize
in interface IWikiModel
public void substituteTemplateCall(java.lang.String templateName, java.util.Map<java.lang.String,java.lang.String> parameterMap, java.lang.Appendable writer) throws java.io.IOException
substituteTemplateCall
in interface IWikiModel
templateName
- the name of the templateparameterMap
- the templates parameter java.util.SortedMap
cacheKey
- a key for using in a cachewriter
- the buffer to append the substituted template content
java.io.IOException
public TagStack swapStack(TagStack stack)
swapStack
in interface IWikiModel
public void tearDown()
tearDown
in interface IWikiModel
public java.util.List<BaseToken> toNodeList(java.lang.String rawWikiText)
rawWikiText
and return
the parsed node list.
rawWikiText
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |