blob: 934358a9e0576c039278ad4948c7c7cf35240d30 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_22) on Tue Sep 18 20:44:14 GMT+01:00 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
LineFormatter (HttpComponents Core 4.2.2 API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.http.message.LineFormatter interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="LineFormatter (HttpComponents Core 4.2.2 API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/LineFormatter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/http/message/HeaderValueParser.html" title="interface in org.apache.http.message"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/http/message/LineParser.html" title="interface in org.apache.http.message"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/http/message/LineFormatter.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="LineFormatter.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.http.message</FONT>
<BR>
Interface LineFormatter</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/http/message/BasicLineFormatter.html" title="class in org.apache.http.message">BasicLineFormatter</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>LineFormatter</B></DL>
</PRE>
<P>
Interface for formatting elements of the HEAD section of an HTTP message.
This is the complement to <A HREF="../../../../org/apache/http/message/LineParser.html" title="interface in org.apache.http.message"><CODE>LineParser</CODE></A>.
There are individual methods for formatting a request line, a
status line, or a header line. The formatting does <i>not</i> include the
trailing line break sequence CR-LF.
Instances of this interface are expected to be stateless and thread-safe.
<p>
The formatted lines are returned in memory, the formatter does not depend
on any specific IO mechanism.
In order to avoid unnecessary creation of temporary objects,
a buffer can be passed as argument to all formatting methods.
The implementation may or may not actually use that buffer for formatting.
If it is used, the buffer will first be cleared by the
<code>formatXXX</code> methods.
The argument buffer can always be re-used after the call. The buffer
returned as the result, if it is different from the argument buffer,
MUST NOT be modified.
</p>
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>4.0</DD>
</DL>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineFormatter.html#appendProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.ProtocolVersion)">appendProtocolVersion</A></B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer,
<A HREF="../../../../org/apache/http/ProtocolVersion.html" title="class in org.apache.http">ProtocolVersion</A>&nbsp;version)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats a protocol version.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineFormatter.html#formatHeader(org.apache.http.util.CharArrayBuffer, org.apache.http.Header)">formatHeader</A></B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer,
<A HREF="../../../../org/apache/http/Header.html" title="interface in org.apache.http">Header</A>&nbsp;header)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats a header.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineFormatter.html#formatRequestLine(org.apache.http.util.CharArrayBuffer, org.apache.http.RequestLine)">formatRequestLine</A></B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer,
<A HREF="../../../../org/apache/http/RequestLine.html" title="interface in org.apache.http">RequestLine</A>&nbsp;reqline)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats a request line.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineFormatter.html#formatStatusLine(org.apache.http.util.CharArrayBuffer, org.apache.http.StatusLine)">formatStatusLine</A></B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer,
<A HREF="../../../../org/apache/http/StatusLine.html" title="interface in org.apache.http">StatusLine</A>&nbsp;statline)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats a status line.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="appendProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.ProtocolVersion)"><!-- --></A><H3>
appendProtocolVersion</H3>
<PRE>
<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A> <B>appendProtocolVersion</B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer,
<A HREF="../../../../org/apache/http/ProtocolVersion.html" title="class in org.apache.http">ProtocolVersion</A>&nbsp;version)</PRE>
<DL>
<DD>Formats a protocol version.
This method does <i>not</i> follow the general contract for
<code>buffer</code> arguments.
It does <i>not</i> clear the argument buffer, but appends instead.
The returned buffer can always be modified by the caller.
Because of these differing conventions, it is not named
<code>formatProtocolVersion</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer to which to append, or <code>null</code><DD><CODE>version</CODE> - the protocol version to format
<DT><B>Returns:</B><DD>a buffer with the formatted protocol version appended.
The caller is allowed to modify the result buffer.
If the <code>buffer</code> argument is not <code>null</code>,
the returned buffer is the argument buffer.</DL>
</DD>
</DL>
<HR>
<A NAME="formatRequestLine(org.apache.http.util.CharArrayBuffer, org.apache.http.RequestLine)"><!-- --></A><H3>
formatRequestLine</H3>
<PRE>
<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A> <B>formatRequestLine</B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer,
<A HREF="../../../../org/apache/http/RequestLine.html" title="interface in org.apache.http">RequestLine</A>&nbsp;reqline)</PRE>
<DL>
<DD>Formats a request line.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer available for formatting, or
<code>null</code>.
The buffer will be cleared before use.<DD><CODE>reqline</CODE> - the request line to format
<DT><B>Returns:</B><DD>the formatted request line</DL>
</DD>
</DL>
<HR>
<A NAME="formatStatusLine(org.apache.http.util.CharArrayBuffer, org.apache.http.StatusLine)"><!-- --></A><H3>
formatStatusLine</H3>
<PRE>
<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A> <B>formatStatusLine</B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer,
<A HREF="../../../../org/apache/http/StatusLine.html" title="interface in org.apache.http">StatusLine</A>&nbsp;statline)</PRE>
<DL>
<DD>Formats a status line.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer available for formatting, or
<code>null</code>.
The buffer will be cleared before use.<DD><CODE>statline</CODE> - the status line to format
<DT><B>Returns:</B><DD>the formatted status line
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/http/ParseException.html" title="class in org.apache.http">ParseException</A></CODE> - in case of a parse error</DL>
</DD>
</DL>
<HR>
<A NAME="formatHeader(org.apache.http.util.CharArrayBuffer, org.apache.http.Header)"><!-- --></A><H3>
formatHeader</H3>
<PRE>
<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A> <B>formatHeader</B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer,
<A HREF="../../../../org/apache/http/Header.html" title="interface in org.apache.http">Header</A>&nbsp;header)</PRE>
<DL>
<DD>Formats a header.
Due to header continuation, the result may be multiple lines.
In order to generate well-formed HTTP, the lines in the result
must be separated by the HTTP line break sequence CR-LF.
There is <i>no</i> trailing CR-LF in the result.
<br/>
See the class comment for details about the buffer argument.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer available for formatting, or
<code>null</code>.
The buffer will be cleared before use.<DD><CODE>header</CODE> - the header to format
<DT><B>Returns:</B><DD>a buffer holding the formatted header, never <code>null</code>.
The returned buffer may be different from the argument buffer.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/http/ParseException.html" title="class in org.apache.http">ParseException</A></CODE> - in case of a parse error</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/LineFormatter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/http/message/HeaderValueParser.html" title="interface in org.apache.http.message"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/http/message/LineParser.html" title="interface in org.apache.http.message"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/http/message/LineFormatter.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="LineFormatter.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2005-2012 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>