Source Code Cross Referenced for LineParser.java in  » Net » httpcomponents-core-4.0-beta1 » org » apache » http » message » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » httpcomponents core 4.0 beta1 » org.apache.http.message 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $HeadURL: https://svn.apache.org/repos/asf/httpcomponents/httpcore/tags/4.0-beta1/module-main/src/main/java/org/apache/http/message/LineParser.java $
003:         * $Revision: 589374 $
004:         * $Date: 2007-10-28 17:25:07 +0100 (Sun, 28 Oct 2007) $
005:         *
006:         * ====================================================================
007:         * Licensed to the Apache Software Foundation (ASF) under one
008:         * or more contributor license agreements.  See the NOTICE file
009:         * distributed with this work for additional information
010:         * regarding copyright ownership.  The ASF licenses this file
011:         * to you under the Apache License, Version 2.0 (the
012:         * "License"); you may not use this file except in compliance
013:         * with the License.  You may obtain a copy of the License at
014:         *
015:         *   http://www.apache.org/licenses/LICENSE-2.0
016:         *
017:         * Unless required by applicable law or agreed to in writing,
018:         * software distributed under the License is distributed on an
019:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
020:         * KIND, either express or implied.  See the License for the
021:         * specific language governing permissions and limitations
022:         * under the License.
023:         * ====================================================================
024:         *
025:         * This software consists of voluntary contributions made by many
026:         * individuals on behalf of the Apache Software Foundation.  For more
027:         * information on the Apache Software Foundation, please see
028:         * <http://www.apache.org/>.
029:         *
030:         */
031:
032:        package org.apache.http.message;
033:
034:        import org.apache.http.ProtocolVersion;
035:        import org.apache.http.ParseException;
036:        import org.apache.http.RequestLine;
037:        import org.apache.http.StatusLine;
038:        import org.apache.http.Header;
039:        import org.apache.http.util.CharArrayBuffer;
040:
041:        /**
042:         * Interface for parsing lines in the HEAD section of an HTTP message.
043:         * There are individual methods for parsing a request line, a
044:         * status line, or a header line.
045:         * The lines to parse are passed in memory, the parser does not depend
046:         * on any specific IO mechanism.
047:         * Instances of this interface are expected to be stateless and thread-safe.
048:         *
049:         * @author <a href="mailto:rolandw AT apache.org">Roland Weber</a>
050:         *
051:         *
052:         * <!-- empty lines above to avoid 'svn diff' context problems -->
053:         * @version $Revision: 589374 $ $Date: 2007-10-28 17:25:07 +0100 (Sun, 28 Oct 2007) $
054:         *
055:         * @since 4.0
056:         */
057:        public interface LineParser {
058:
059:            /**
060:             * Parses the textual representation of a protocol version.
061:             * This is needed for parsing request lines (last element)
062:             * as well as status lines (first element).
063:             *
064:             * @param buffer    a buffer holding the protocol version to parse
065:             * @param cursor    the parser cursor containing the current position and 
066:             *                  the bounds within the buffer for the parsing operation
067:             * 
068:             * @return  the parsed protocol version
069:             *
070:             * @throws ParseException        in case of a parse error
071:             */
072:            ProtocolVersion parseProtocolVersion(CharArrayBuffer buffer,
073:                    ParserCursor cursor) throws ParseException;
074:
075:            /**
076:             * Checks whether there likely is a protocol version in a line.
077:             * This method implements a <i>heuristic</i> to check for a
078:             * likely protocol version specification. It does <i>not</i>
079:             * guarantee that {@link #parseProtocolVersion} would not
080:             * detect a parse error.
081:             * This can be used to detect garbage lines before a request
082:             * or status line.
083:             *
084:             * @param buffer    a buffer holding the line to inspect
085:             * @param cursor    the cursor at which to check for a protocol version, or
086:             *                  negative for "end of line". Whether the check tolerates
087:             *                  whitespace before or after the protocol version is
088:             *                  implementation dependent.
089:             *
090:             * @return  <code>true</code> if there is a protocol version at the
091:             *          argument index (possibly ignoring whitespace),
092:             *          <code>false</code> otherwise
093:             */
094:            boolean hasProtocolVersion(CharArrayBuffer buffer,
095:                    ParserCursor cursor);
096:
097:            /**
098:             * Parses a request line.
099:             *
100:             * @param buffer    a buffer holding the line to parse
101:             * @param cursor    the parser cursor containing the current position and 
102:             *                  the bounds within the buffer for the parsing operation
103:             *
104:             * @return  the parsed request line
105:             *
106:             * @throws ParseException        in case of a parse error
107:             */
108:            RequestLine parseRequestLine(CharArrayBuffer buffer,
109:                    ParserCursor cursor) throws ParseException;
110:
111:            /**
112:             * Parses a status line.
113:             *
114:             * @param buffer    a buffer holding the line to parse
115:             * @param cursor    the parser cursor containing the current position and 
116:             *                  the bounds within the buffer for the parsing operation
117:             *
118:             * @return  the parsed status line
119:             *
120:             * @throws ParseException        in case of a parse error
121:             */
122:            StatusLine parseStatusLine(CharArrayBuffer buffer,
123:                    ParserCursor cursor) throws ParseException;
124:
125:            /**
126:             * Creates a header from a line.
127:             * The full header line is expected here. Header continuation lines
128:             * must be joined by the caller before invoking this method.
129:             *
130:             * @param buffer    a buffer holding the full header line.
131:             *                  This buffer MUST NOT be re-used afterwards, since
132:             *                  the returned object may reference the contents later.
133:             *
134:             * @return  the header in the argument buffer.
135:             *          The returned object MAY be a wrapper for the argument buffer.
136:             *          The argument buffer MUST NOT be re-used or changed afterwards.
137:             *
138:             * @throws ParseException        in case of a parse error
139:             */
140:            Header parseHeader(CharArrayBuffer buffer) throws ParseException;
141:
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.