|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.model.AbstractDescribableImpl<MarkupFormatter>
hudson.markup.MarkupFormatter
public abstract class MarkupFormatter
Generalization of a function that takes text with some markup and converts that to HTML. Such markup is often associated with Wiki.
Use of markup, as opposed to using raw HTML, ensures certain degree of security.
This is an extension point in Hudson, allowing plugins to implement different markup formatters.
Implement the following methods to enable and control CodeMirror syntax highlighting public String getCodeMirrorMode() // return null to disable CodeMirror dynamically public String getCodeMirrorConfig()
This extension point must have a valid config.jelly that feeds the constructor.
TODO: allow MarkupFormatter
to control the UI that the user uses to edit.
Jenkins.getMarkupFormatter()
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
Constructor Summary | |
---|---|
MarkupFormatter()
|
Method Summary | |
---|---|
org.kohsuke.stapler.HttpResponse |
doPreviewDescription(String text)
Generate HTML for preview, using markup formatter. |
MarkupFormatterDescriptor |
getDescriptor()
Gets the descriptor for this instance. |
String |
getHelpUrl()
Gets the URL of the help file. |
String |
translate(String markup)
|
abstract void |
translate(String markup,
Writer output)
Given the text, converts that to HTML according to whatever markup rules implicit in the implementation class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MarkupFormatter()
Method Detail |
---|
public abstract void translate(String markup, Writer output) throws IOException
Multiple threads can call this method concurrently with different inputs.
output
- Formatted HTML should be sent to this output.
IOException
public final String translate(String markup) throws IOException
IOException
public String getHelpUrl()
public MarkupFormatterDescriptor getDescriptor()
Describable
Descriptor
is a singleton for every concrete Describable
implementation, so if a.getClass()==b.getClass() then
a.getDescriptor()==b.getDescriptor() must hold.
getDescriptor
in interface Describable<MarkupFormatter>
getDescriptor
in class AbstractDescribableImpl<MarkupFormatter>
public org.kohsuke.stapler.HttpResponse doPreviewDescription(@QueryParameter String text) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |