Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 80D34200CE7 for ; Mon, 10 Jul 2017 02:21:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7F52F167F52; Mon, 10 Jul 2017 00:21:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 78227167F49 for ; Mon, 10 Jul 2017 02:21:23 +0200 (CEST) Received: (qmail 97609 invoked by uid 500); 10 Jul 2017 00:20:46 -0000 Mailing-List: contact commits-help@juneau.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.incubator.apache.org Delivered-To: mailing list commits@juneau.incubator.apache.org Received: (qmail 97592 invoked by uid 99); 10 Jul 2017 00:20:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jul 2017 00:20:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3C414191754 for ; Mon, 10 Jul 2017 00:19:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id rARViBDjtNVo for ; Mon, 10 Jul 2017 00:18:56 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 29FDA623AD for ; Mon, 10 Jul 2017 00:09:15 +0000 (UTC) Received: (qmail 87130 invoked by uid 99); 10 Jul 2017 00:09:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jul 2017 00:09:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8BD9BE96A8; Mon, 10 Jul 2017 00:09:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jamesbognar@apache.org To: commits@juneau.incubator.apache.org Date: Mon, 10 Jul 2017 00:09:16 -0000 Message-Id: <0a48488a08d24191815da19b2c5a7263@git.apache.org> In-Reply-To: <08221ca5342b46a28c50a50a900a508b@git.apache.org> References: <08221ca5342b46a28c50a50a900a508b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/23] incubator-juneau-website git commit: Update javadocs. archived-at: Mon, 10 Jul 2017 00:21:26 -0000 http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/03d6af50/content/site/apidocs/src-html/org/apache/juneau/rest/RestResponse.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RestResponse.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RestResponse.html index d80c5f6..a9e7e13 100644 --- a/content/site/apidocs/src-html/org/apache/juneau/rest/RestResponse.html +++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RestResponse.html @@ -452,7 +452,7 @@ 444 * The format of this value is plain text. 445 * 446 * <p> -447 * It gets wrapped in a <code><xt>&lt;h3&gt; <xa>class</xa>=<xs>'title'</xs>&gt;</xt></code> element and then added +447 * It gets wrapped in a <code><xt>&lt;h1&gt;</xt></code> element and then added 448 * to the <code><xt>&lt;header&gt;</code> section on the page. 449 * 450 * <p> @@ -504,7 +504,7 @@ 496 * The format of this value is plain text. 497 * 498 * <p> -499 * It gets wrapped in a <code><xt>&lt;h5&gt; <xa>class</xa>=<xs>'description'</xs>&gt;</xt></code> element and then +499 * It gets wrapped in a <code><xt>&lt;h2&gt;</xt></code> element and then 500 * added to the <code><xt>&lt;header&gt;</code> section on the page. 501 * 502 * <p> @@ -640,299 +640,298 @@ 632 * 633 * @param value 634 * The HTML nav section links links. -635 * Object will be converted to a string using {@link Object#toString()}. -636 * <p> -637 * <ul class='doctree'> -638 * <li class='info'> -639 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to -640 * waste string concatenation cycles on non-HTML views. -641 * </ul> -642 * @return This object (for method chaining). -643 */ -644 public RestResponse setHtmlLinks(Object value) { -645 properties.put(HtmlDocSerializerContext.HTMLDOC_links, value); -646 return this; -647 } -648 -649 /** -650 * Sets the HTML nav section contents. -651 * -652 * <p> -653 * The format of this value is HTML. -654 * -655 * <p> -656 * The nav section of the page contains the links. -657 * -658 * <p> -659 * The format of this value is HTML. -660 * -661 * <p> -662 * When a value is specified, the {@link #setHtmlLinks(Object)} value will be ignored. -663 * -664 * <p> -665 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). -666 * -667 * <p> -668 * A value of <js>"NONE"</js> can be used to force no value. -669 * -670 * <p> -671 * This is the programmatic equivalent to the {@link HtmlDoc#nav() @HtmlDoc.nav()} annotation. -672 * -673 * @param value -674 * The HTML nav section contents. -675 * Object will be converted to a string using {@link Object#toString()}. -676 * <p> -677 * <ul class='doctree'> -678 * <li class='info'> -679 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to -680 * waste string concatenation cycles on non-HTML views. -681 * </ul> -682 * @return This object (for method chaining). -683 */ -684 public RestResponse setHtmlNav(Object value) { -685 properties.put(HtmlDocSerializerContext.HTMLDOC_nav, value); -686 return this; -687 } -688 -689 /** -690 * Sets the HTML aside section contents. -691 * -692 * <p> -693 * The format of this value is HTML. -694 * -695 * <p> -696 * The aside section typically floats on the right side of the page. -697 * -698 * <p> -699 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). -700 * -701 * <p> -702 * A value of <js>"NONE"</js> can be used to force no value. -703 * -704 * <p> -705 * This is the programmatic equivalent to the {@link HtmlDoc#aside() @HtmlDoc.aside()} annotation. -706 * -707 * @param value -708 * The HTML aside section contents. -709 * Object will be converted to a string using {@link Object#toString()}. -710 * <p> -711 * <ul class='doctree'> -712 * <li class='info'> -713 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to waste -714 * string concatenation cycles on non-HTML views. -715 * </ul> -716 * @return This object (for method chaining). -717 */ -718 public RestResponse setHtmlAside(Object value) { -719 properties.put(HtmlDocSerializerContext.HTMLDOC_aside, value); -720 return this; -721 } -722 -723 /** -724 * Sets the HTML footer section contents. -725 * -726 * <p> -727 * The format of this value is HTML. -728 * -729 * <p> -730 * The footer section typically floats on the bottom of the page. -731 * -732 * <p> -733 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). -734 * -735 * <p> -736 * A value of <js>"NONE"</js> can be used to force no value. -737 * -738 * <p> -739 * This is the programmatic equivalent to the {@link HtmlDoc#footer() @HtmlDoc.footer()} annotation. -740 * -741 * @param value -742 * The HTML footer section contents. -743 * Object will be converted to a string using {@link Object#toString()}. -744 * <p> -745 * <ul class='doctree'> -746 * <li class='info'> -747 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to -748 * waste string concatenation cycles on non-HTML views. -749 * </ul> -750 * @return This object (for method chaining). -751 */ -752 public RestResponse setHtmlFooter(Object value) { -753 properties.put(HtmlDocSerializerContext.HTMLDOC_footer, value); -754 return this; -755 } -756 -757 /** -758 * Sets the HTML CSS style section contents. -759 * -760 * <p> -761 * The format of this value is CSS. -762 * -763 * <p> -764 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). -765 * -766 * <p> -767 * A value of <js>"NONE"</js> can be used to force no value. -768 * -769 * <p> -770 * This is the programmatic equivalent to the {@link HtmlDoc#style() @HtmlDoc.style()} annotation. -771 * -772 * @param value -773 * The HTML CSS style section contents. -774 * Object will be converted to a string using {@link Object#toString()}. -775 * <p> -776 * <ul class='doctree'> -777 * <li class='info'> -778 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to -779 * waste string concatenation cycles on non-HTML views. -780 * </ul> -781 * @return This object (for method chaining). -782 */ -783 public RestResponse setHtmlStyle(Object value) { -784 properties.put(HtmlDocSerializerContext.HTMLDOC_style, value); -785 return this; -786 } -787 -788 /** -789 * Sets the CSS URL in the HTML CSS style section. -790 * -791 * <p> -792 * The format of this value is a comma-delimited list of URLs. -793 * -794 * <p> -795 * Specifies the URL to the stylesheet to add as a link in the style tag in the header. -796 * -797 * <p> -798 * The format of this value is CSS. -799 * -800 * <p> -801 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>) and can use URL protocols defined -802 * by {@link UriResolver}. -803 * -804 * <p> -805 * This is the programmatic equivalent to the {@link HtmlDoc#stylesheet() @HtmlDoc.stylesheet()} annotation. -806 * -807 * @param value -808 * The CSS URL in the HTML CSS style section. -809 * Object will be converted to a string using {@link Object#toString()}. -810 * <p> -811 * <ul class='doctree'> -812 * <li class='info'> -813 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to -814 * waste string concatenation cycles on non-HTML views. -815 * </ul> -816 * @return This object (for method chaining). -817 */ -818 public RestResponse setHtmlStylesheet(Object value) { -819 properties.put(HtmlDocSerializerContext.HTMLDOC_stylesheet, value); -820 return this; -821 } -822 -823 /** -824 * Sets the HTML script section contents. -825 * -826 * <p> -827 * The format of this value is Javascript. -828 * -829 * <p> -830 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). -831 * -832 * <p> -833 * A value of <js>"NONE"</js> can be used to force no value. -834 * -835 * <p> -836 * This is the programmatic equivalent to the {@link HtmlDoc#script() @HtmlDoc.script()} annotation. -837 * -838 * @param value -839 * The HTML script section contents. -840 * Object will be converted to a string using {@link Object#toString()}. -841 * <p> -842 * <ul class='doctree'> -843 * <li class='info'> -844 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to -845 * waste string concatenation cycles on non-HTML views. -846 * </ul> -847 * @return This object (for method chaining). -848 */ -849 public RestResponse setHtmlScript(Object value) { -850 properties.put(HtmlDocSerializerContext.HTMLDOC_script, value); -851 return this; -852 } -853 -854 /** -855 * Shorthand method for forcing the rendered HTML content to be no-wrap. -856 * -857 * <p> -858 * This is the programmatic equivalent to the {@link HtmlDoc#nowrap() @HtmlDoc.nowrap()} annotation. -859 * -860 * @param value The new nowrap setting. -861 * @return This object (for method chaining). -862 */ -863 public RestResponse setHtmlNoWrap(boolean value) { -864 properties.put(HtmlDocSerializerContext.HTMLDOC_nowrap, value); -865 return this; -866 } -867 -868 /** -869 * Specifies the text to display when serializing an empty array or collection. -870 * -871 * <p> -872 * This is the programmatic equivalent to the {@link HtmlDoc#noResultsMessage() @HtmlDoc.noResultsMessage()} -873 * annotation. -874 * -875 * @param value The text to display when serializing an empty array or collection. -876 * @return This object (for method chaining). -877 */ -878 public RestResponse setHtmlNoResultsMessage(Object value) { -879 properties.put(HtmlDocSerializerContext.HTMLDOC_noResultsMessage, value); -880 return this; -881 } -882 -883 /** -884 * Specifies the template class to use for rendering the HTML page. -885 * -886 * <p> -887 * By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide your own custom -888 * renderer or subclasses from the basic class to have full control over how the page is rendered. -889 * -890 * <p> -891 * This is the programmatic equivalent to the {@link HtmlDoc#template() @HtmlDoc.template()} annotation. -892 * -893 * @param value The HTML page template to use to render the HTML page. -894 * @return This object (for method chaining). -895 */ -896 public RestResponse setHtmlTemplate(Class<? extends HtmlDocTemplate> value) { -897 properties.put(HtmlDocSerializerContext.HTMLDOC_template, value); -898 return this; -899 } -900 -901 /** -902 * Specifies the template class to use for rendering the HTML page. -903 * -904 * <p> -905 * By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide your own custom -906 * renderer or subclasses from the basic class to have full control over how the page is rendered. -907 * -908 * <p> -909 * This is the programmatic equivalent to the {@link HtmlDoc#template() @HtmlDoc.template()} annotation. -910 * -911 * @param value The HTML page template to use to render the HTML page. -912 * @return This object (for method chaining). -913 */ -914 public RestResponse setHtmlTemplate(HtmlDocTemplate value) { -915 properties.put(HtmlDocSerializerContext.HTMLDOC_template, value); -916 return this; -917 } -918 -919 @Override /* ServletResponse */ -920 public void flushBuffer() throws IOException { -921 if (w != null) -922 w.flush(); -923 if (os != null) -924 os.flush(); -925 super.flushBuffer(); -926 } -927} +635 * <p> +636 * <ul class='doctree'> +637 * <li class='info'> +638 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to +639 * waste string concatenation cycles on non-HTML views. +640 * </ul> +641 * @return This object (for method chaining). +642 */ +643 public RestResponse setHtmlLinks(String[] value) { +644 properties.put(HtmlDocSerializerContext.HTMLDOC_links, value); +645 return this; +646 } +647 +648 /** +649 * Sets the HTML nav section contents. +650 * +651 * <p> +652 * The format of this value is HTML. +653 * +654 * <p> +655 * The nav section of the page contains the links. +656 * +657 * <p> +658 * The format of this value is HTML. +659 * +660 * <p> +661 * When a value is specified, the {@link #setHtmlLinks(String[])} value will be ignored. +662 * +663 * <p> +664 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). +665 * +666 * <p> +667 * A value of <js>"NONE"</js> can be used to force no value. +668 * +669 * <p> +670 * This is the programmatic equivalent to the {@link HtmlDoc#nav() @HtmlDoc.nav()} annotation. +671 * +672 * @param value +673 * The HTML nav section contents. +674 * Object will be converted to a string using {@link Object#toString()}. +675 * <p> +676 * <ul class='doctree'> +677 * <li class='info'> +678 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to +679 * waste string concatenation cycles on non-HTML views. +680 * </ul> +681 * @return This object (for method chaining). +682 */ +683 public RestResponse setHtmlNav(Object value) { +684 properties.put(HtmlDocSerializerContext.HTMLDOC_nav, value); +685 return this; +686 } +687 +688 /** +689 * Sets the HTML aside section contents. +690 * +691 * <p> +692 * The format of this value is HTML. +693 * +694 * <p> +695 * The aside section typically floats on the right side of the page. +696 * +697 * <p> +698 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). +699 * +700 * <p> +701 * A value of <js>"NONE"</js> can be used to force no value. +702 * +703 * <p> +704 * This is the programmatic equivalent to the {@link HtmlDoc#aside() @HtmlDoc.aside()} annotation. +705 * +706 * @param value +707 * The HTML aside section contents. +708 * Object will be converted to a string using {@link Object#toString()}. +709 * <p> +710 * <ul class='doctree'> +711 * <li class='info'> +712 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to waste +713 * string concatenation cycles on non-HTML views. +714 * </ul> +715 * @return This object (for method chaining). +716 */ +717 public RestResponse setHtmlAside(Object value) { +718 properties.put(HtmlDocSerializerContext.HTMLDOC_aside, value); +719 return this; +720 } +721 +722 /** +723 * Sets the HTML footer section contents. +724 * +725 * <p> +726 * The format of this value is HTML. +727 * +728 * <p> +729 * The footer section typically floats on the bottom of the page. +730 * +731 * <p> +732 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). +733 * +734 * <p> +735 * A value of <js>"NONE"</js> can be used to force no value. +736 * +737 * <p> +738 * This is the programmatic equivalent to the {@link HtmlDoc#footer() @HtmlDoc.footer()} annotation. +739 * +740 * @param value +741 * The HTML footer section contents. +742 * Object will be converted to a string using {@link Object#toString()}. +743 * <p> +744 * <ul class='doctree'> +745 * <li class='info'> +746 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to +747 * waste string concatenation cycles on non-HTML views. +748 * </ul> +749 * @return This object (for method chaining). +750 */ +751 public RestResponse setHtmlFooter(Object value) { +752 properties.put(HtmlDocSerializerContext.HTMLDOC_footer, value); +753 return this; +754 } +755 +756 /** +757 * Sets the HTML CSS style section contents. +758 * +759 * <p> +760 * The format of this value is CSS. +761 * +762 * <p> +763 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). +764 * +765 * <p> +766 * A value of <js>"NONE"</js> can be used to force no value. +767 * +768 * <p> +769 * This is the programmatic equivalent to the {@link HtmlDoc#style() @HtmlDoc.style()} annotation. +770 * +771 * @param value +772 * The HTML CSS style section contents. +773 * Object will be converted to a string using {@link Object#toString()}. +774 * <p> +775 * <ul class='doctree'> +776 * <li class='info'> +777 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to +778 * waste string concatenation cycles on non-HTML views. +779 * </ul> +780 * @return This object (for method chaining). +781 */ +782 public RestResponse setHtmlStyle(Object value) { +783 properties.put(HtmlDocSerializerContext.HTMLDOC_style, value); +784 return this; +785 } +786 +787 /** +788 * Sets the CSS URL in the HTML CSS style section. +789 * +790 * <p> +791 * The format of this value is a comma-delimited list of URLs. +792 * +793 * <p> +794 * Specifies the URL to the stylesheet to add as a link in the style tag in the header. +795 * +796 * <p> +797 * The format of this value is CSS. +798 * +799 * <p> +800 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>) and can use URL protocols defined +801 * by {@link UriResolver}. +802 * +803 * <p> +804 * This is the programmatic equivalent to the {@link HtmlDoc#stylesheet() @HtmlDoc.stylesheet()} annotation. +805 * +806 * @param value +807 * The CSS URL in the HTML CSS style section. +808 * Object will be converted to a string using {@link Object#toString()}. +809 * <p> +810 * <ul class='doctree'> +811 * <li class='info'> +812 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to +813 * waste string concatenation cycles on non-HTML views. +814 * </ul> +815 * @return This object (for method chaining). +816 */ +817 public RestResponse setHtmlStylesheet(Object value) { +818 properties.put(HtmlDocSerializerContext.HTMLDOC_stylesheet, value); +819 return this; +820 } +821 +822 /** +823 * Sets the HTML script section contents. +824 * +825 * <p> +826 * The format of this value is Javascript. +827 * +828 * <p> +829 * This field can contain variables (e.g. <js>"$L{my.localized.variable}"</js>). +830 * +831 * <p> +832 * A value of <js>"NONE"</js> can be used to force no value. +833 * +834 * <p> +835 * This is the programmatic equivalent to the {@link HtmlDoc#script() @HtmlDoc.script()} annotation. +836 * +837 * @param value +838 * The HTML script section contents. +839 * Object will be converted to a string using {@link Object#toString()}. +840 * <p> +841 * <ul class='doctree'> +842 * <li class='info'> +843 * <b>Tip:</b> Use {@link StringMessage} to generate value with delayed serialization so as not to +844 * waste string concatenation cycles on non-HTML views. +845 * </ul> +846 * @return This object (for method chaining). +847 */ +848 public RestResponse setHtmlScript(Object value) { +849 properties.put(HtmlDocSerializerContext.HTMLDOC_script, value); +850 return this; +851 } +852 +853 /** +854 * Shorthand method for forcing the rendered HTML content to be no-wrap. +855 * +856 * <p> +857 * This is the programmatic equivalent to the {@link HtmlDoc#nowrap() @HtmlDoc.nowrap()} annotation. +858 * +859 * @param value The new nowrap setting. +860 * @return This object (for method chaining). +861 */ +862 public RestResponse setHtmlNoWrap(boolean value) { +863 properties.put(HtmlDocSerializerContext.HTMLDOC_nowrap, value); +864 return this; +865 } +866 +867 /** +868 * Specifies the text to display when serializing an empty array or collection. +869 * +870 * <p> +871 * This is the programmatic equivalent to the {@link HtmlDoc#noResultsMessage() @HtmlDoc.noResultsMessage()} +872 * annotation. +873 * +874 * @param value The text to display when serializing an empty array or collection. +875 * @return This object (for method chaining). +876 */ +877 public RestResponse setHtmlNoResultsMessage(Object value) { +878 properties.put(HtmlDocSerializerContext.HTMLDOC_noResultsMessage, value); +879 return this; +880 } +881 +882 /** +883 * Specifies the template class to use for rendering the HTML page. +884 * +885 * <p> +886 * By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide your own custom +887 * renderer or subclasses from the basic class to have full control over how the page is rendered. +888 * +889 * <p> +890 * This is the programmatic equivalent to the {@link HtmlDoc#template() @HtmlDoc.template()} annotation. +891 * +892 * @param value The HTML page template to use to render the HTML page. +893 * @return This object (for method chaining). +894 */ +895 public RestResponse setHtmlTemplate(Class<? extends HtmlDocTemplate> value) { +896 properties.put(HtmlDocSerializerContext.HTMLDOC_template, value); +897 return this; +898 } +899 +900 /** +901 * Specifies the template class to use for rendering the HTML page. +902 * +903 * <p> +904 * By default, uses {@link HtmlDocTemplateBasic} to render the contents, although you can provide your own custom +905 * renderer or subclasses from the basic class to have full control over how the page is rendered. +906 * +907 * <p> +908 * This is the programmatic equivalent to the {@link HtmlDoc#template() @HtmlDoc.template()} annotation. +909 * +910 * @param value The HTML page template to use to render the HTML page. +911 * @return This object (for method chaining). +912 */ +913 public RestResponse setHtmlTemplate(HtmlDocTemplate value) { +914 properties.put(HtmlDocSerializerContext.HTMLDOC_template, value); +915 return this; +916 } +917 +918 @Override /* ServletResponse */ +919 public void flushBuffer() throws IOException { +920 if (w != null) +921 w.flush(); +922 if (os != null) +923 os.flush(); +924 super.flushBuffer(); +925 } +926} http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/03d6af50/content/site/apidocs/src-html/org/apache/juneau/rest/RestServletDefault.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RestServletDefault.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RestServletDefault.html index ff1792e..47bbdf2 100644 --- a/content/site/apidocs/src-html/org/apache/juneau/rest/RestServletDefault.html +++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RestServletDefault.html @@ -219,17 +219,20 @@ 211 */ 212 @RestMethod(name="OPTIONS", path="/*", 213 htmldoc=@HtmlDoc( -214 links="{back:'servlet:/',json:'servlet:/?method=OPTIONS&Accept=text/json&plainText=true'}", -215 description="Swagger documentation", -216 aside="NONE" -217 ), -218 summary="Resource options", -219 description="Swagger documentation" -220 ) -221 public Swagger getOptions(RestRequest req) { -222 return req.getSwagger(); -223 } -224} +214 links={ +215 "back: servlet:/,", +216 "json: servlet:/?method=OPTIONS&Accept=text/json&plainText=true" +217 }, +218 description="Swagger documentation", +219 aside="NONE" +220 ), +221 summary="Resource options", +222 description="Swagger documentation" +223 ) +224 public Swagger getOptions(RestRequest req) { +225 return req.getSwagger(); +226 } +227} http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/03d6af50/content/site/apidocs/src-html/org/apache/juneau/rest/UrlPathPattern.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/UrlPathPattern.html b/content/site/apidocs/src-html/org/apache/juneau/rest/UrlPathPattern.html index 7e40ea8..82dfc7c 100644 --- a/content/site/apidocs/src-html/org/apache/juneau/rest/UrlPathPattern.html +++ b/content/site/apidocs/src-html/org/apache/juneau/rest/UrlPathPattern.html @@ -102,105 +102,110 @@ 094 if (path == null) 095 return (patternString.equals("/") ? new String[]{} : null); 096 -097 Matcher m = pattern.matcher(path); -098 if (! m.matches()) -099 return null; -100 -101 int len = m.groupCount(); -102 String[] v = new String[len]; -103 -104 for (int i = 0; i < len; i++) { -105 if (isDotAll && i == len-1) -106 v[i] = m.group(i+1).isEmpty() ? null : m.group(i+1).substring(1); -107 else -108 v[i] = urlDecode(m.group(i+1)); -109 } -110 -111 return v; -112 } -113 -114 /** -115 * Comparator for this object. -116 * -117 * <p> -118 * The comparator is designed to order URL pattern from most-specific to least-specific. -119 * For example, the following patterns would be ordered as follows: -120 * <ol> -121 * <li><code>/foo/bar</code> -122 * <li><code>/foo/bar/*</code> -123 * <li><code>/foo/{id}/bar</code> -124 * <li><code>/foo/{id}/bar/*</code> -125 * <li><code>/foo/{id}</code> -126 * <li><code>/foo/{id}/*</code> -127 * <li><code>/foo</code> -128 * <li><code>/foo/*</code> -129 * </ol> -130 */ -131 @Override /* Comparable */ -132 public int compareTo(UrlPathPattern o) { -133 String s1 = patternString.replaceAll("\\{[^\\}]+\\}", ".").replaceAll("\\w+", "X").replaceAll("\\.", "W"); -134 String s2 = o.patternString.replaceAll("\\{[^\\}]+\\}", ".").replaceAll("\\w+", "X").replaceAll("\\.", "W"); -135 if (s1.isEmpty()) -136 s1 = "+"; -137 if (s2.isEmpty()) -138 s2 = "+"; -139 if (! s1.endsWith("/*")) -140 s1 = s1 + "/W"; -141 if (! s2.endsWith("/*")) -142 s2 = s2 + "/W"; -143 int c = s2.compareTo(s1); -144 if (c == 0) -145 return o.toRegEx().compareTo(toRegEx()); -146 return c; -147 } -148 -149 @Override /* Object */ -150 public boolean equals(Object o) { -151 if (! (o instanceof UrlPathPattern)) -152 return false; -153 return (compareTo((UrlPathPattern)o) == 0); -154 } -155 -156 @Override /* Object */ -157 public int hashCode() { -158 return super.hashCode(); +097 // If we're not doing a /* match, ignore all trailing slashes. +098 if (! isDotAll) +099 while (path.length() > 1 && path.charAt(path.length()-1) == '/') +100 path = path.substring(0, path.length()-1); +101 +102 Matcher m = pattern.matcher(path); +103 if (! m.matches()) +104 return null; +105 +106 int len = m.groupCount(); +107 String[] v = new String[len]; +108 +109 for (int i = 0; i < len; i++) { +110 if (isDotAll && i == len-1) +111 v[i] = m.group(i+1).isEmpty() ? null : m.group(i+1).substring(1); +112 else +113 v[i] = urlDecode(m.group(i+1)); +114 } +115 +116 return v; +117 } +118 +119 /** +120 * Comparator for this object. +121 * +122 * <p> +123 * The comparator is designed to order URL pattern from most-specific to least-specific. +124 * For example, the following patterns would be ordered as follows: +125 * <ol> +126 * <li><code>/foo/bar</code> +127 * <li><code>/foo/bar/*</code> +128 * <li><code>/foo/{id}/bar</code> +129 * <li><code>/foo/{id}/bar/*</code> +130 * <li><code>/foo/{id}</code> +131 * <li><code>/foo/{id}/*</code> +132 * <li><code>/foo</code> +133 * <li><code>/foo/*</code> +134 * </ol> +135 */ +136 @Override /* Comparable */ +137 public int compareTo(UrlPathPattern o) { +138 String s1 = patternString.replaceAll("\\{[^\\}]+\\}", ".").replaceAll("\\w+", "X").replaceAll("\\.", "W"); +139 String s2 = o.patternString.replaceAll("\\{[^\\}]+\\}", ".").replaceAll("\\w+", "X").replaceAll("\\.", "W"); +140 if (s1.isEmpty()) +141 s1 = "+"; +142 if (s2.isEmpty()) +143 s2 = "+"; +144 if (! s1.endsWith("/*")) +145 s1 = s1 + "/W"; +146 if (! s2.endsWith("/*")) +147 s2 = s2 + "/W"; +148 int c = s2.compareTo(s1); +149 if (c == 0) +150 return o.toRegEx().compareTo(toRegEx()); +151 return c; +152 } +153 +154 @Override /* Object */ +155 public boolean equals(Object o) { +156 if (! (o instanceof UrlPathPattern)) +157 return false; +158 return (compareTo((UrlPathPattern)o) == 0); 159 } 160 161 @Override /* Object */ -162 public String toString() { -163 return patternString; +162 public int hashCode() { +163 return super.hashCode(); 164 } 165 -166 /** -167 * Returns this path pattern as the compiled regular expression. -168 * -169 * <p> -170 * Useful for debugging. -171 * -172 * @return The path pattern. -173 */ -174 public String toRegEx() { -175 return isOnlyDotAll ? "*" : pattern.pattern(); -176 } -177 -178 /** -179 * Bean property getter: <property>vars</property>. -180 * -181 * @return The value of the <property>vars</property> property on this bean, or <jk>null</jk> if it is not set. -182 */ -183 public String[] getVars() { -184 return vars; -185 } -186 -187 /** -188 * Bean property getter: <property>patternString</property>. -189 * -190 * @return The value of the <property>patternString</property> property on this bean, or <jk>null</jk> if it is not set. -191 */ -192 public String getPatternString() { -193 return patternString; -194 } -195} +166 @Override /* Object */ +167 public String toString() { +168 return patternString; +169 } +170 +171 /** +172 * Returns this path pattern as the compiled regular expression. +173 * +174 * <p> +175 * Useful for debugging. +176 * +177 * @return The path pattern. +178 */ +179 public String toRegEx() { +180 return isOnlyDotAll ? "*" : pattern.pattern(); +181 } +182 +183 /** +184 * Bean property getter: <property>vars</property>. +185 * +186 * @return The value of the <property>vars</property> property on this bean, or <jk>null</jk> if it is not set. +187 */ +188 public String[] getVars() { +189 return vars; +190 } +191 +192 /** +193 * Bean property getter: <property>patternString</property>. +194 * +195 * @return The value of the <property>patternString</property> property on this bean, or <jk>null</jk> if it is not set. +196 */ +197 public String getPatternString() { +198 return patternString; +199 } +200}