blob: 91fa4a5d8e9932a00ec3b4c6def1381bb1624129 [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>
LineParser (HttpComponents Core 4.2.2 API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.http.message.LineParser interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="LineParser (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/LineParser.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/LineFormatter.html" title="interface in org.apache.http.message"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/http/message/ParserCursor.html" title="class 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/LineParser.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="LineParser.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 LineParser</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/http/message/BasicLineParser.html" title="class in org.apache.http.message">BasicLineParser</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>LineParser</B></DL>
</PRE>
<P>
Interface for parsing lines in the HEAD section of an HTTP message.
There are individual methods for parsing a request line, a
status line, or a header line.
The lines to parse are passed in memory, the parser does not depend
on any specific IO mechanism.
Instances of this interface are expected to be stateless and thread-safe.
<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;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineParser.html#hasProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)">hasProtocolVersion</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/message/ParserCursor.html" title="class in org.apache.http.message">ParserCursor</A>&nbsp;cursor)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks whether there likely is a protocol version in a 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/Header.html" title="interface in org.apache.http">Header</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineParser.html#parseHeader(org.apache.http.util.CharArrayBuffer)">parseHeader</A></B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a header from a 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/ProtocolVersion.html" title="class in org.apache.http">ProtocolVersion</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineParser.html#parseProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)">parseProtocolVersion</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/message/ParserCursor.html" title="class in org.apache.http.message">ParserCursor</A>&nbsp;cursor)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parses the textual representation of 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/RequestLine.html" title="interface in org.apache.http">RequestLine</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineParser.html#parseRequestLine(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)">parseRequestLine</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/message/ParserCursor.html" title="class in org.apache.http.message">ParserCursor</A>&nbsp;cursor)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parses 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/StatusLine.html" title="interface in org.apache.http">StatusLine</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/http/message/LineParser.html#parseStatusLine(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)">parseStatusLine</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/message/ParserCursor.html" title="class in org.apache.http.message">ParserCursor</A>&nbsp;cursor)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parses 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="parseProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)"><!-- --></A><H3>
parseProtocolVersion</H3>
<PRE>
<A HREF="../../../../org/apache/http/ProtocolVersion.html" title="class in org.apache.http">ProtocolVersion</A> <B>parseProtocolVersion</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/message/ParserCursor.html" title="class in org.apache.http.message">ParserCursor</A>&nbsp;cursor)
throws <A HREF="../../../../org/apache/http/ParseException.html" title="class in org.apache.http">ParseException</A></PRE>
<DL>
<DD>Parses the textual representation of a protocol version.
This is needed for parsing request lines (last element)
as well as status lines (first element).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer holding the protocol version to parse<DD><CODE>cursor</CODE> - the parser cursor containing the current position and
the bounds within the buffer for the parsing operation
<DT><B>Returns:</B><DD>the parsed protocol version
<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="hasProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)"><!-- --></A><H3>
hasProtocolVersion</H3>
<PRE>
boolean <B>hasProtocolVersion</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/message/ParserCursor.html" title="class in org.apache.http.message">ParserCursor</A>&nbsp;cursor)</PRE>
<DL>
<DD>Checks whether there likely is a protocol version in a line.
This method implements a <i>heuristic</i> to check for a
likely protocol version specification. It does <i>not</i>
guarantee that <A HREF="../../../../org/apache/http/message/LineParser.html#parseProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)"><CODE>parseProtocolVersion(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)</CODE></A> would not
detect a parse error.
This can be used to detect garbage lines before a request
or status line.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer holding the line to inspect<DD><CODE>cursor</CODE> - the cursor at which to check for a protocol version, or
negative for "end of line". Whether the check tolerates
whitespace before or after the protocol version is
implementation dependent.
<DT><B>Returns:</B><DD><code>true</code> if there is a protocol version at the
argument index (possibly ignoring whitespace),
<code>false</code> otherwise</DL>
</DD>
</DL>
<HR>
<A NAME="parseRequestLine(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)"><!-- --></A><H3>
parseRequestLine</H3>
<PRE>
<A HREF="../../../../org/apache/http/RequestLine.html" title="interface in org.apache.http">RequestLine</A> <B>parseRequestLine</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/message/ParserCursor.html" title="class in org.apache.http.message">ParserCursor</A>&nbsp;cursor)
throws <A HREF="../../../../org/apache/http/ParseException.html" title="class in org.apache.http">ParseException</A></PRE>
<DL>
<DD>Parses a request line.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer holding the line to parse<DD><CODE>cursor</CODE> - the parser cursor containing the current position and
the bounds within the buffer for the parsing operation
<DT><B>Returns:</B><DD>the parsed request 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="parseStatusLine(org.apache.http.util.CharArrayBuffer, org.apache.http.message.ParserCursor)"><!-- --></A><H3>
parseStatusLine</H3>
<PRE>
<A HREF="../../../../org/apache/http/StatusLine.html" title="interface in org.apache.http">StatusLine</A> <B>parseStatusLine</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/message/ParserCursor.html" title="class in org.apache.http.message">ParserCursor</A>&nbsp;cursor)
throws <A HREF="../../../../org/apache/http/ParseException.html" title="class in org.apache.http">ParseException</A></PRE>
<DL>
<DD>Parses a status line.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer holding the line to parse<DD><CODE>cursor</CODE> - the parser cursor containing the current position and
the bounds within the buffer for the parsing operation
<DT><B>Returns:</B><DD>the parsed 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="parseHeader(org.apache.http.util.CharArrayBuffer)"><!-- --></A><H3>
parseHeader</H3>
<PRE>
<A HREF="../../../../org/apache/http/Header.html" title="interface in org.apache.http">Header</A> <B>parseHeader</B>(<A HREF="../../../../org/apache/http/util/CharArrayBuffer.html" title="class in org.apache.http.util">CharArrayBuffer</A>&nbsp;buffer)
throws <A HREF="../../../../org/apache/http/ParseException.html" title="class in org.apache.http">ParseException</A></PRE>
<DL>
<DD>Creates a header from a line.
The full header line is expected here. Header continuation lines
must be joined by the caller before invoking this method.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - a buffer holding the full header line.
This buffer MUST NOT be re-used afterwards, since
the returned object may reference the contents later.
<DT><B>Returns:</B><DD>the header in the argument buffer.
The returned object MAY be a wrapper for the argument buffer.
The argument buffer MUST NOT be re-used or changed afterwards.
<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/LineParser.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/LineFormatter.html" title="interface in org.apache.http.message"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/http/message/ParserCursor.html" title="class 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/LineParser.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="LineParser.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>