public class DocJScriptContext
extends org.scripthelper.context.DefaultScriptContext
context
object. Many methods of this context are
only a xrapper around the underlying HookContext
.Constructor and Description |
---|
DocJScriptContext() |
Modifier and Type | Method and Description |
---|---|
XMLParagraph |
addParagraph(XMLArticle article)
Add a paragraph to an arricle.
|
XMLArticle |
createArticle(java.lang.String desc)
Create an article.
|
XMLArticle |
createArticle(java.lang.String id,
java.lang.String desc)
Create an article.
|
XMLArticle |
createArticle(java.lang.String id,
java.lang.String desc,
boolean keepCase)
Create an article.
|
void |
echo(java.lang.String message)
Echo an information message through the parser integrated console.
|
void |
err(java.lang.String message)
Echo an error message to the
System.err Stream. |
void |
error(java.lang.String message)
Echo an error message through the parser integrated console.
|
int |
getElementIndex()
Return the index of the currently handled element in the wiki source tree.
|
java.util.List<ParagraphElement> |
getElementsAfter()
Return all the elements after the current element.
|
java.util.List<ParagraphElement> |
getElementsBefore()
Return all the elements before the current element.
|
org.docgene.model.globals.ArticlesModel |
getModel()
Return the Articles Model.
|
ParagraphElement |
getNextElement()
Return the next element after the current element.
|
ParagraphElement |
getPreviousElement()
Return the previous element before the current element.
|
ParagraphElement |
getSiblingElement(int elementOffset)
Return a sibling element with an offset relative to the current element.
|
java.lang.String |
getSiblingElementTypeDecl(int elementOffset)
Return the type declaration of the sibling element with an offset relative to the current element.
|
java.util.Set<java.lang.String> |
getSupportedDeclarations(java.lang.String... decl)
Creates a set of elements declarations which will be handled by this ElementHook.
|
java.lang.String |
getText(XMLCode code)
Return the text associated with a code element.
|
java.lang.String |
getText(XMLPre pre)
Return the text associated with a pre element.
|
boolean |
hasNextElement()
Return true if there is a next element after the current element.
|
boolean |
hasPreviousElement()
Return true if there is a previous element before the current element.
|
void |
insertElementsAfter(ParagraphElement... elements)
Insert a list of elements after the current element.
|
void |
insertElementsBefore(ParagraphElement... elements)
Insert a list of elements before the current element.
|
void |
out(java.lang.String message)
Echo a message to the
System.out Stream. |
void |
removeCurrentElement()
Remove the current element.
|
__step__, abort, echo, getPath, getScriptLogger, getScriptSource, getScriptWrapper, setLogger, setScriptSource, setScriptWrapper
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearLoggerTab, clearTab, createScript, createScript, createScript, createScript, echo, echo, getAdditionalHelper, getAdditionalHelpers, getHelper, getLoggerTab, getMainScriptObject, getScriptFile, getScriptObject, getScriptObject, hasAdditionalHelpers, setLoggerTab, setProgress, setTab
public java.util.Set<java.lang.String> getSupportedDeclarations(java.lang.String... decl)
decl
- the raay of elements declarationspublic void echo(java.lang.String message)
DirectoryParser.addInfo(java.lang.String)
.echo
in interface org.scripthelper.context.ScriptContext
echo
in class org.scripthelper.context.DefaultScriptContext
message
- the messagepublic void out(java.lang.String message)
System.out
Stream.message
- the messagepublic void err(java.lang.String message)
System.err
Stream.message
- the messagepublic void error(java.lang.String message)
DirectoryParser.addInfo(java.lang.String)
.error
in interface org.scripthelper.context.ScriptContext
error
in class org.scripthelper.context.DefaultScriptContext
message
- the messagepublic int getElementIndex()
public boolean hasPreviousElement()
public boolean hasNextElement()
public ParagraphElement getPreviousElement()
public ParagraphElement getNextElement()
public java.util.List<ParagraphElement> getElementsAfter()
insertElementsAfter(org.docgene.model.ParagraphElement...)
if you want to add new elements.
This does not take into account modifications added by the script.public java.util.List<ParagraphElement> getElementsBefore()
public ParagraphElement getSiblingElement(int elementOffset)
elementOffset
- the offsetpublic java.lang.String getSiblingElementTypeDecl(int elementOffset)
elementOffset
- the offsetpublic void removeCurrentElement()
public void insertElementsBefore(ParagraphElement... elements)
elements
- the list of elementspublic void insertElementsAfter(ParagraphElement... elements)
elements
- the list of elementspublic XMLArticle createArticle(java.lang.String desc)
desc
- the article descriptionpublic XMLArticle createArticle(java.lang.String id, java.lang.String desc)
id
- the article id (maybe null)desc
- the article descriptionpublic XMLParagraph addParagraph(XMLArticle article)
article
- the articlepublic XMLArticle createArticle(java.lang.String id, java.lang.String desc, boolean keepCase)
id
- the article id (maybe null)desc
- the article descriptionkeepCase
- true if the article description should keep the title description casepublic java.lang.String getText(XMLCode code)
code
- the code elementpublic java.lang.String getText(XMLPre pre)
pre
- the pre elementpublic org.docgene.model.globals.ArticlesModel getModel()
Copyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence