Source Code Cross Referenced for LineFormatter.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/LineFormatter.java $
003:         * $Revision: 573864 $
004:         * $Date: 2007-09-08 17:53:25 +0200 (Sat, 08 Sep 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.RequestLine;
036:        import org.apache.http.StatusLine;
037:        import org.apache.http.Header;
038:        import org.apache.http.util.CharArrayBuffer;
039:
040:        /**
041:         * Interface for formatting elements of the HEAD section of an HTTP message.
042:         * This is the complement to {@link LineParser}.
043:         * There are individual methods for formatting a request line, a
044:         * status line, or a header line. The formatting does <i>not</i> include the
045:         * trailing line break sequence CR-LF.
046:         * Instances of this interface are expected to be stateless and thread-safe.
047:         *
048:         * <p>
049:         * The formatted lines are returned in memory, the formatter does not depend
050:         * on any specific IO mechanism.
051:         * In order to avoid unnecessary creation of temporary objects,
052:         * a buffer can be passed as argument to all formatting methods.
053:         * The implementation may or may not actually use that buffer for formatting.
054:         * If it is used, the buffer will first be cleared by the
055:         * <code>formatXXX</code> methods.
056:         * The argument buffer can always be re-used after the call. The buffer
057:         * returned as the result, if it is different from the argument buffer,
058:         * MUST NOT be modified.
059:         * </p>
060:         *
061:         *
062:         * @author <a href="mailto:rolandw AT apache.org">Roland Weber</a>
063:         *
064:         *
065:         * <!-- empty lines above to avoid 'svn diff' context problems -->
066:         * @version $Revision: 573864 $ $Date: 2007-09-08 17:53:25 +0200 (Sat, 08 Sep 2007) $
067:         *
068:         * @since 4.0
069:         */
070:        public interface LineFormatter {
071:
072:            /**
073:             * Formats a protocol version.
074:             * This method does <i>not</i> follow the general contract for
075:             * <code>buffer</code> arguments.
076:             * It does <i>not</i> clear the argument buffer, but appends instead.
077:             * The returned buffer can always be modified by the caller.
078:             * Because of these differing conventions, it is not named
079:             * <code>formatProtocolVersion</code>.
080:             *
081:             * @param buffer    a buffer to which to append, or <code>null</code>
082:             * @param version   the protocol version to format
083:             *
084:             * @return  a buffer with the formatted protocol version appended.
085:             *          The caller is allowed to modify the result buffer.
086:             *          If the <code>buffer</code> argument is not <code>null</code>,
087:             *          the returned buffer is the argument buffer.
088:             */
089:            CharArrayBuffer appendProtocolVersion(CharArrayBuffer buffer,
090:                    ProtocolVersion version);
091:
092:            /**
093:             * Formats a request line.
094:             *
095:             * @param buffer    a buffer available for formatting, or
096:             *                  <code>null</code>.
097:             *                  The buffer will be cleared before use.
098:             * @param reqline   the request line to format
099:             *
100:             * @return  the formatted request line
101:             */
102:            CharArrayBuffer formatRequestLine(CharArrayBuffer buffer,
103:                    RequestLine reqline);
104:
105:            /**
106:             * Formats a status line.
107:             *
108:             * @param buffer    a buffer available for formatting, or
109:             *                  <code>null</code>.
110:             *                  The buffer will be cleared before use.
111:             * @param statline  the status line to format
112:             *
113:             * @return  the formatted status line
114:             *
115:             * @throws ParseException        in case of a parse error
116:             */
117:            CharArrayBuffer formatStatusLine(CharArrayBuffer buffer,
118:                    StatusLine statline);
119:
120:            /**
121:             * Formats a header.
122:             * Due to header continuation, the result may be multiple lines.
123:             * In order to generate well-formed HTTP, the lines in the result
124:             * must be separated by the HTTP line break sequence CR-LF.
125:             * There is <i>no</i> trailing CR-LF in the result.
126:             * <br/>
127:             * See the class comment for details about the buffer argument.
128:             *
129:             * @param buffer    a buffer available for formatting, or
130:             *                  <code>null</code>.
131:             *                  The buffer will be cleared before use.
132:             * @param header    the header to format
133:             *
134:             * @return  a buffer holding the formatted header, never <code>null</code>.
135:             *          The returned buffer may be different from the argument buffer.
136:             *
137:             * @throws ParseException        in case of a parse error
138:             */
139:            CharArrayBuffer formatHeader(CharArrayBuffer buffer, Header header);
140:
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.