PageRenderTime 32ms CodeModel.GetById 26ms app.highlight 4ms RepoModel.GetById 0ms app.codeStats 1ms

/hudson-core/src/main/java/hudson/markup/RawHtmlMarkupFormatter.java

http://github.com/hudson/hudson
Java | 34 lines | 22 code | 6 blank | 6 comment | 0 complexity | a8a3b2bc499066b68f01cb7422c9d755 MD5 | raw file
 1package hudson.markup;
 2
 3import hudson.Extension;
 4import org.kohsuke.stapler.DataBoundConstructor;
 5
 6import java.io.IOException;
 7import java.io.Writer;
 8
 9/**
10 * {@link MarkupFormatter} that treats the input as the raw html.
11 * This is the backward compatible behaviour.
12 *
13 * @author Kohsuke Kawaguchi
14 */
15public class RawHtmlMarkupFormatter extends MarkupFormatter {
16    @DataBoundConstructor
17    public RawHtmlMarkupFormatter() {
18    }
19
20    @Override
21    public void translate(String markup, Writer output) throws IOException {
22        output.write(markup);
23    }
24
25    @Extension
26    public static class DescriptorImpl extends MarkupFormatterDescriptor {
27        @Override
28        public String getDisplayName() {
29            return "Raw HTML";
30        }
31    }
32
33    public static MarkupFormatter INSTANCE = new RawHtmlMarkupFormatter();
34}