- Index
- »
- fan.web
- »
- WebOutStream
WebOutStream
@Js
class WebOutStream : OutStream
WebOutStream provides methods for generating XML and XHTML content.
Construct a WebOutStream that wraps the given OutStream
Start a <select> tag
Write out a complete <hr/> tag
Convenience for input("type='text'" + attrs)
Convenience for input("type='password'" + attrs)
Customize how the JavaScript runtime environment is initialized
End a <aside> tag
End a <h5> tag
Start a <nav> tag
End a <span> tag
End a <div> tag
Write a complete <link> tag for an external CSS stylesheet
Start a <script> tag
End a <footer> tag
Write a complete <input> tag
End a <b> tag
Start a <style> tag
End a <li> tag
End a <header> tag
Write out a complete <br/> tag
End a <textarea> tag
Write a complete <link> tag for a RSS feed resource
End a <th> tag
End a <section> tag
Convenience for input("type='checkbox'" + attrs)
Start a <table> tag
End a <h2> tag
Start a <a> tag
Start a <b> tag
Write the XHTML Strict DOCTYPE
End a <ul> tag
Start a <i> tag
End a <label> tag
Start a <p> tag
Start a <td> tag
Start a <tfoot> tag
Write the HTML5 DOCTYPE
Write obj.toStr to the stream as valid XML text
Start a <th> tag
Convenience for writeChars(obj.toStr)
End a <p> tag
Write a complete <link> tag for an Atom feed resource
Start a <li> tag
Start a <tr> tag
Start a <span> tag
End a <style> tag
Start a <textarea> tag
Start a <dd> tag
End a <dl> tag
End a <h1> tag
End a <i> tag
Start a <tbody> tag
Start a <dl> tag
End a <select> tag
End a <thead> tag
Start a <main> tag
Start a <section> tag
Start a <body> tag
End a <code> tag
End a <table> tag
Convenience for input("type='radio'" + attrs)
Start a <div> tag
Start a <dt> tag
End a <dd> tag
Convenience for writeChars(Str.spaces(numSpaces))
End a <a> tag
Start a <ul> tag
Write an end tag
Start a <html> tag
Write a start tag
End a <body> tag
End a <html> tag
End a <dt> tag
Start a <pre> tag
Start a <em> tag
End a <tbody> tag
End a <pre> tag
Start a <article> tag
Start a <aside> tag
Start a <header> tag
End a <h4> tag
End a <head> tag
Convenience for writeChar(\n)
Start a <option> tag
End a <h3> tag
Write a complete <img> tag
Start a <code> tag
Convenience for input("type='hidden'" + attrs)
Convenience for input("type='submit'" + attrs)
Start a <footer> tag
Start a <thead> tag
Start a <h1> tag
Start a <h2> tag
Start a <h3> tag
Start a <h4> tag
Write a complete <title> tag
Start a <h5> tag
Start a <h6> tag
Convenience for input("type='button'" + attrs)
Start a <head> tag
End a <article> tag
End a <em> tag
Write a complete <link> tag for a favicon
Write a complete <script> tag for an external JavaScript file
End a <option> tag
End a <td> tag
Start a <ol> tag
End a <tfoot> tag
End a <form> tag
End a <main> tag
End a <title> tag
End a <tr> tag
Start a <label> tag
Write out a prolog statement using the streams current charset encoding
End a <ol> tag
Start a <form> tag
End a <script> tag
End a <nav> tag
End a <h6> tag
This a(Uri href, Str? attrs)
Start a <a> tag.
This aEnd()
End a <a> tag.
This article(Str? attrs)
Start a <article> tag.
This articleEnd()
End a <article> tag.
This aside(Str? attrs)
Start a <aside> tag.
This asideEnd()
End a <aside> tag.
This atom(Uri href, Str? attrs)
Write a complete <link> tag for an Atom feed resource.
This b(Str? attrs)
Start a <b> tag.
This bEnd()
End a <b> tag.
This body(Str? attrs)
Start a <body> tag.
This bodyEnd()
End a <body> tag.
This br()
Write out a complete <br/> tag.
This button(Str? attrs)
Convenience for input("type='button'" + attrs).
This checkbox(Str? attrs)
Convenience for input("type='checkbox'" + attrs)
This code(Str? attrs)
Start a <code> tag.
This codeEnd()
End a <code> tag.
This dd(Str? attrs)
Start a <dd> tag.
This ddEnd()
End a <dd> tag.
This div(Str? attrs)
Start a <div> tag.
This divEnd()
End a <div> tag.
This dl(Str? attrs)
Start a <dl> tag.
This dlEnd()
End a <dl> tag.
This docType()
Write the XHTML Strict DOCTYPE.
This docType5()
Write the HTML5 DOCTYPE.
This dt(Str? attrs)
Start a <dt> tag.
This dtEnd()
End a <dt> tag.
This em(Str? attrs)
Start a <em> tag.
This emEnd()
End a <em> tag.
This esc(Obj? obj)
Write obj.toStr to the stream as valid XML text. The special control characters amp, lt, apos and quot are always escaped. The gt char is escaped only if it is the first char or if preceeded by the ] char. Also see Str.toXml. If obj is null, then "null" is written.
This favIcon(Uri href, Str? attrs)
Write a complete <link> tag for a favicon. You must specifiy the MIME type for your icon in the attrs argument:
out.favIcon(`/fav.png`, "type='image/png'")
This footer(Str? attrs)
Start a <footer> tag.
This footerEnd()
End a <footer> tag.
This form(Str? attrs)
Start a <form> tag.
This formEnd()
End a <form> tag.
This h1(Str? attrs)
Start a <h1> tag.
This h1End()
End a <h1> tag.
This h2(Str? attrs)
Start a <h2> tag.
This h2End()
End a <h2> tag.
This h3(Str? attrs)
Start a <h3> tag.
This h3End()
End a <h3> tag.
This h4(Str? attrs)
Start a <h4> tag.
This h4End()
End a <h4> tag.
This h5(Str? attrs)
Start a <h5> tag.
This h5End()
End a <h5> tag.
This h6(Str? attrs)
Start a <h6> tag.
This h6End()
End a <h6> tag.
This head()
Start a <head> tag.
This headEnd()
End a <head> tag.
This header(Str? attrs)
Start a <header> tag.
This headerEnd()
End a <header> tag.
This hidden(Str? attrs)
Convenience for input("type='hidden'" + attrs).
This hr(Str? attrs)
Write out a complete <hr/> tag.
This html()
Start a <html> tag.
This htmlEnd()
End a <html> tag.
This i(Str? attrs)
Start a <i> tag.
This iEnd()
End a <i> tag.
This img(Uri src, Str? attrs)
Write a complete <img> tag.
This includeCss(Uri href)
Write a complete <link> tag for an external CSS stylesheet. If this URI has already been included in this WebOutStream instance, then this method does nothing.
This includeJs(Uri? href)
Write a complete <script> tag for an external JavaScript file. If this URI has already been included in this WebOutStream instance, then this method does nothing.
This initJs(Str:Str env)
Customize how the JavaScript runtime environment is initialized. This method must be called inside the <head> tag, and also before sys.js is loaded in order to take effect.
Note this method is not necessary if no customization is needed. The JS runtime will automatically initialize using default values.
The following variables are supported:
timezone: set the default TimeZone for JsVMlocale: set the default Locale for the JsVM. Note you must manually provide the locale config.props files. See FilePack.toLocaleJsFile.main: an optional method to invoke after the page has been loaded. Themainargument can be either a type or method. If no method is specified,mainis used. If the method is not static, a new instance of type is created:"foo::Instance" => Instance().main() "foo::Instance.bar" => Instance().bar() "foo::Static" => Static.main() "foo::Static.bar" => Static.bar()
This input(Str? attrs)
Write a complete <input> tag.
This label(Str? attrs)
Start a <label> tag.
This labelEnd()
End a <label> tag.
This li(Str? attrs)
Start a <li> tag.
This liEnd()
End a <li> tag.
This main(Str? attrs)
Start a <main> tag.
This mainEnd()
End a <main> tag.
new make(OutStream out)
Construct a WebOutStream that wraps the given OutStream.
This nav(Str? attrs)
Start a <nav> tag.
This navEnd()
End a <nav> tag.
This nl()
Convenience for writeChar(\n).
This ol(Str? attrs)
Start a <ol> tag.
This olEnd()
End a <ol> tag.
This option(Str? attrs)
Start a <option> tag.
This optionEnd()
End a <option> tag.
This p(Str? attrs)
Start a <p> tag.
This pEnd()
End a <p> tag.
This password(Str? attrs)
Convenience for input("type='password'" + attrs).
This pre(Str? attrs)
Start a <pre> tag.
This preEnd()
End a <pre> tag.
This prolog()
Write out a prolog statement using the streams current charset encoding.
This radio(Str? attrs)
Convenience for input("type='radio'" + attrs)
This rss(Uri href, Str? attrs)
Write a complete <link> tag for a RSS feed resource.
This script(Str? attrs)
Start a <script> tag.
This scriptEnd()
End a <script> tag.
This section(Str? attrs)
Start a <section> tag.
This sectionEnd()
End a <section> tag.
This select(Str? attrs)
Start a <select> tag.
This selectEnd()
End a <select> tag.
This span(Str? attrs)
Start a <span> tag.
This spanEnd()
End a <span> tag.
This style(Str? attrs)
Start a <style> tag.
This styleEnd()
End a <style> tag.
This submit(Str? attrs)
Convenience for input("type='submit'" + attrs).
This tab(Int numSpaces)
Convenience for writeChars(Str.spaces(numSpaces)).
This table(Str? attrs)
Start a <table> tag.
This tableEnd()
End a <table> tag.
This tag(Str elemName, Str? attrs, Bool empty)
Write a start tag. Use attrs to fully specify the attributes manually. Use empty to optionally close this element without using an end tag.
This tagEnd(Str elemName)
Write an end tag.
This tbody(Str? attrs)
Start a <tbody> tag.
This tbodyEnd()
End a <tbody> tag.
This td(Str? attrs)
Start a <td> tag.
This tdEnd()
End a <td> tag.
This textArea(Str? attrs)
Start a <textarea> tag.
This textAreaEnd()
End a <textarea> tag.
This textField(Str? attrs)
Convenience for input("type='text'" + attrs).
This tfoot(Str? attrs)
Start a <tfoot> tag.
This tfootEnd()
End a <tfoot> tag.
This th(Str? attrs)
Start a <th> tag.
This thEnd()
End a <th> tag.
This thead(Str? attrs)
Start a <thead> tag.
This theadEnd()
End a <thead> tag.
This title(Str? attrs)
Write a complete <title> tag.
This titleEnd()
End a <title> tag.
This tr(Str? attrs)
Start a <tr> tag.
This trEnd()
End a <tr> tag.
This ul(Str? attrs)
Start a <ul> tag.
This ulEnd()
End a <ul> tag.
This w(Obj? obj)
Convenience for writeChars(obj.toStr).