incubator-wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ngalla...@apache.org
Subject svn commit: r787550 [3/3] - in /incubator/wink/contrib/ibm-jaxrs/resources: ./ META-INF/ META-INF/services/ dist/ docs/ docs/site/ docs/site/en/ docs/site/en/appdeveloperguide/ docs/site/en/appdeveloperguide/webcontainers/ docs/site/en/samples/ docs/si...
Date Tue, 23 Jun 2009 05:30:07 GMT
Added: incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/samples/xml/index.html
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/samples/xml/index.html?rev=787550&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/samples/xml/index.html (added)
+++ incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/samples/xml/index.html Tue Jun 23 05:30:05 2009
@@ -0,0 +1,462 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta name="copyright" content="IBM Corporation 2008" />
+<meta name="DC.Rights.Owner" content="IBM Corporation 2008" />
+<!-- All rights reserved. Licensed Materials Property of IBM -->
+<!-- US Government Users Restricted Rights -->
+<!-- Use, duplication or disclosure restricted by -->
+<!-- GSA ADP Schedule Contract with IBM Corp. -->
+
+<link rel="stylesheet" href="../../book.css" type="text/css">
+<link rel="stylesheet" href="../../../siteonly/site.css" type="text/css">
+<title>IBM JAX-RS: XML Phonebook Sample</title>
+</head>
+
+<body>
+<!-- Header information -->
+<iframe src="../../header.html" scrolling="no" frameborder="0"
+	style="width: 100%; height: 75px;"><a href="../../header.html">Hmm,
+you are using a very old browser. Click here to go directly to included
+content.</a></iframe>
+
+<h2 align="center">XML Phonebook Sample Application Guide</h2>
+<h4 align="center">Version 1.0.0</h4>
+
+<h2 class="topictitle1">Overview</h2>
+
+<div>
+<p>The XML Phonebook sample demonstrates various ways that XML can
+be processed in requests and responses.</p>
+
+<p>Incoming requests can have a payload referred to as the request
+entity. In order for JAX-RS resource methods to process a request
+entity, a single unannotated parameter can be in the method signature.
+The parameter can be any type that has a corresponding JAX-RS
+MessageBodyReader entity provider.</p>
+
+<p>Outgoing responses can also have a payload, known as the response
+entity. JAX-RS resource methods can return a Java object which is then
+written out by a JAX-RS MessageBodyWriter entity provider.</p>
+
+<p>In this sample, some of the standard included JAX-RS entity
+providers are used to read and write XML content.</p>
+
+</div>
+
+<div class="section">
+<h3 class="sectiontitle">Standard Entity Providers</h3>
+
+<p>Here is a table with the standard entity providers which are
+included with every JAX-RS 1.0 runtime:</p>
+
+<div>
+<div class="tableborder">
+<table cellspacing="0" cellpadding="4" frame="border" border="1"
+	rules="all">
+	<caption>Table 2. Standard Entity Providers</caption>
+	<thead>
+		<tr>
+			<th>Java Type</th>
+			<th>MessageBodyReader</th>
+			<th>MessageBodyWriter</th>
+			<th>Supported Content-Types</th>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td>byte[]</td>
+			<td>X</td>
+			<td>X</td>
+			<td>*/*</td>
+		</tr>
+		<tr>
+			<td>java.io.InputStream</td>
+			<td>X</td>
+			<td>X</td>
+			<td>*/*</td>
+		</tr>
+		<tr>
+			<td>java.io.Reader</td>
+			<td>X</td>
+			<td>X</td>
+			<td>*/*</td>
+		</tr>
+		<tr>
+			<td>java.lang.String</td>
+			<td>X</td>
+			<td>X</td>
+			<td>*/*</td>
+		</tr>
+		<tr>
+			<td>java.io.File</td>
+			<td>X</td>
+			<td>X</td>
+			<td>*/*</td>
+		</tr>
+		<tr>
+			<td>javax.activation.DataSource</td>
+			<td>X</td>
+			<td>X</td>
+			<td>*/*</td>
+		</tr>
+		<tr>
+			<td>javax.xml.transform.Source</td>
+			<td>X</td>
+			<td>X</td>
+			<td>text/xml, application/xml, application/*+xml</td>
+		</tr>
+		<tr>
+			<td>javax.ws.rs.core.MultivaluedMap</td>
+			<td>X</td>
+			<td>X</td>
+			<td>application/x-www-form-urlencoded</td>
+		</tr>
+		<tr>
+			<td>JAXB types</td>
+			<td>X</td>
+			<td>X</td>
+			<td>text/xml, application/xml, application/*+xml</td>
+		</tr>
+		<tr>
+			<td>javax.ws.rs.core.StreamingOutput</td>
+			<td></td>
+			<td>X</td>
+			<td>*/*</td>
+		</tr>
+	</tbody>
+</table>
+</div>
+</div>
+</div>
+
+<p>In the following code example, the incoming request entity is
+stored in the method parameter named "requestEntity" and the response is
+returned. The standard bytes[] MessageBodyReader and MessageBodyWriter
+are used for transforming entities to and from bytes[].</p>
+
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>@GET
+public byte[] processRequest(byte[] requestEntity) {
+    /* do some processing with the requestEntity parameter */
+
+    byte[] responseEntity = new byte[100];
+    /* construct a response */
+    return responseEntity;
+}</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+</div>
+
+<p name="using-stream">Among other types, java.io.InputStream, java.io.Reader,
+java.lang.String, java.io.File, javax.xml.transform.Source Java types,
+and JAXB types can be used to send and receive XML.</p>
+
+<h4>Custom Entity Providers</h4>
+
+<p>JAX-RS provides many standard MessageBodyReaders and
+MessageBodyWriters entity providers, but of course applications can
+provide their own custom entity providers. See the custom entity
+providers sample for more details.</p>
+
+<h4>Content Negotiation</h4>
+
+<p>A common question is how does the JAX-RS runtime know that the
+request content or the response content is of a particular media type.
+Afterall, if bytes[] is returned, the bytes[] could easily represent
+text/plain, application/xml, or any other media type. This is discussed
+in the content negotiation sample.</p>
+
+
+<div class="section">
+<h3 class="sectiontitle">java.io.InputStream and java.io.Reader</h3>
+
+<p>A common way of receiving and returning content is via objects
+that implement <b>java.io.InputStream</b>. Java libraries that read
+InputStreams can be used to more easily parse the content.</p>
+
+<p>A <b>java.io.Reader</b> can be used in a similar fashion as the
+InputStream.</p>
+
+<h4>Advantages and Disadvantages</h4>
+<p>When representing an incoming request, an InputStream allows data
+to be consumed on demand. It can potentially be more memory efficient
+depending on how the InputStream is consumed. For instance, passing the
+InputStream to a <a
+	href="http://en.wikipedia.org/wiki/Simple_API_for_XML">SaX</a>/pull XML
+parser, the XML contents can be read on demand resulting in better
+memory usage but has the traditional tradeoffs where the XML document
+cannot be randomly accessed or immediately validated as well-formed. If
+the InputStream were fed to a <a
+	href="http://en.wikipedia.org/wiki/Document_Object_Model">DOM
+parser</a>, then the entire request would be read so the memory usage is
+higher but random access to the document nodes is allowed. InputStreams
+provide access to the raw bytes of the request entity so are very
+versatile.</p>
+
+<p>For representing response entities, InputStreams may be more
+difficult to construct to return. However, they are again useful for
+memory efficient operations where the response is constructed on demand.
+For example, suppose you want to return a file's contents, you can use a
+FileInputStream to return the contents without loading the entire file
+into memory. If you want to use the response OutputStream directly, look
+into the StreamingOutput return type described below.</p>
+
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>@POST
+@Consumes("text/xml")
+@Produces("text/xml")
+public Response createEntry(InputStream is) throws SAXException, IOException,
+    ParserConfigurationException, URISyntaxException {
+    Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
+
+    NodeList nameNodes = doc.getDocumentElement().getElementsByTagName("name");
+    NodeList numberNodes = doc.getDocumentElement().getElementsByTagName("number");
+
+    /*
+     * add the phone entry
+     */
+    int id = PhoneBook.getPhoneBook().getNextID();
+
+    PhoneEntry entry = new PhoneEntry();
+    entry.setName(nameNodes.item(0).getTextContent());
+    entry.setNumber(numberNodes.item(0).getTextContent());
+
+    PhoneBook.getPhoneBook().getEntries().put(Integer.valueOf(id), entry);
+
+    /*
+     * return XML entity via an InputStream
+     */
+    StringWriter sw = new StringWriter();
+    sw.append("&lt;entry&gt;" + "&lt;id&gt;" + id + "&lt;/id&gt;" + "&lt;name&gt;" + entry.getName() + "&lt;/name&gt;"
+        + "&lt;number&gt;" + entry.getNumber() + "&lt;/number&gt;" + "&lt;/entry&gt;");
+
+    ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(sw.getBuffer()
+        .toString().getBytes());
+
+    return Response.created(new URI(uriInfo.getAbsolutePath() + "/" + id)).entity(byteArrayInputStream).type(MediaType.TEXT_XML_TYPE).build();
+}</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+
+</div>
+
+
+<div class="section">
+<h3 class="sectiontitle">javax.ws.rs.core.StreamingOutput</h3>
+
+<p>For writing content as a response, a Java class that implements <b>javax.ws.rs.core.StreamingOutput</b>
+can be used. The only method in the StreamingOutput interface is a write
+method which provides a java.io.Outputstream to write to.
+StreamingOutput is only as a possible MessageBodyWriter entity Java
+type. It does not work for reading.</p>
+
+<p>In this code snippet, a list of phone book entries are returned
+in the response. An anonymous Java class that implements StreamingOutput
+is returned.</p>
+
+<h4>Advantages and Disadvantages</h4>
+<p>With all streams, StreamingOutput could potentially lead to low
+memory usage. Using a StreamingOutput to write the response allows an
+application developer to write the raw bytes via a familiar OutputStream
+interface.</p>
+
+<p>When using the OutputStream, if you decorate the OutputStream
+with other OutputStream or Writer classes, be sure to flush the
+contents. For instance, suppose you were to wrap the OutputStream with a
+java.io.OutputStreamWriter and then a java.io.BufferedWriter. Then, you
+use the BufferedWriter to write a few characters out. If you do not do a
+Writer.flush(), the characters could stay in the BufferedWriter and
+never be written out to the OutputStream.</p>
+
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>@GET
+@Produces("text/xml")
+public StreamingOutput getDirectory() {
+    final StringWriter sw = new StringWriter();
+    sw.append("&lt;phonebook&gt;");
+    sw.append("&lt;entries&gt;");
+    for (Integer id : PhoneBook.getPhoneBook().getEntries().keySet()) {
+        sw.append("&lt;entry&gt;" + "&lt;href&gt;" + id + "&lt;/href&gt;" + "&lt;/entry&gt;");
+    }
+    sw.append("&lt;/entries&gt;");
+    sw.append("&lt;/phonebook&gt;");
+    
+    return new StreamingOutput() {
+        public void write(OutputStream arg0) throws IOException, WebApplicationException {
+            arg0.write(sw.toString().getBytes());
+            arg0.flush();
+        }
+    };
+}</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+</div>
+
+<div class="section">
+<h3 class="sectiontitle">java.lang.String</h3>
+<p>Another easy way to receive and send content is via a <b>java.lang.String</b>.
+You can manually construct the XML content via a String and return it.
+Processing is more complex but you could also use Java XML libraries to
+help parse strings.</p>
+
+<p>To ensure that this method will only be invoked when requests
+have a text/xml Content-Type and are willing to accept text/xml as a
+response, the @Consumes and @Produces annotations are added to the
+method. This helps limit the expected request payload so that the String
+entity parameter is intended to represent text/xml content. Of course,
+the requesting client could send malformed XML as the payload but still
+specify that the Content-Type is text/xml. Your resource methods should
+have proper error handling.</p>
+
+<h4>Advantages and Disadvantages</h4>
+<p>For representing requests, a String is fairly easy to manipulate
+but requires the entire request entity to be read and stored in memory.
+Also, when using a String, it is generally assumed that incoming
+requests are convertable to Strings. It may be difficult to get the
+original raw bytes of the request entity.</p>
+
+<p>For representing responses, a String again is easy to construct
+but generally requires that the entire String be in memory.</p>
+
+<p>For complex XML in particular, it is difficult to parse and
+construct Strings directly and is recommend that you look into using
+libraries or JAXB.</p>
+
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>@POST
+@Consumes("text/xml")
+@Produces("text/xml")
+public Response createEntry(String requestXMLContent) throws SAXException, IOException,
+    ParserConfigurationException, URISyntaxException {
+    /*
+     * parse the XML content
+     */
+    Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(requestXMLContent);
+
+    NodeList nameNodes = doc.getDocumentElement().getElementsByTagName("name");
+    NodeList numberNodes = doc.getDocumentElement().getElementsByTagName("number");
+
+    /*
+     * add the phone entry
+     */
+    int id = PhoneBook.getPhoneBook().getNextID();
+
+    PhoneEntry entry = new PhoneEntry();
+    entry.setName(nameNodes.item(0).getTextContent());
+    entry.setNumber(numberNodes.item(0).getTextContent());
+
+    PhoneBook.getPhoneBook().getEntries().put(Integer.valueOf(id), entry);
+
+    /*
+     * construct XML entity via a String
+     */
+    StringWriter sw = new StringWriter();
+    sw.append("&lt;entry&gt;" + "&lt;id&gt;" + id + "&lt;/id&gt;" + "&lt;name&gt;" + entry.getName() + "&lt;/name&gt;"
+        + "&lt;number&gt;" + entry.getNumber() + "&lt;/number&gt;" + "&lt;/entry&gt;");
+
+    return Response.created(new URI(uriInfo.getAbsolutePath() + "/" + id)).entity(sw.toString()).type(MediaType.TEXT_XML_TYPE).build();
+}</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+</div>
+
+<div class="section">
+<h3 class="sectiontitle">javax.xml.transform.Source</h3>
+
+<p>JAX-RS 1.0 implementations also provide a MessageBodyReader and
+MessageBodyWriter for <b>javax.xml.transform.Source</b> as well. This
+allows application developers to more easily use some JDK standard XML
+APIs.</p>
+
+<p>Application developers could do various things including using
+XSLT stylesheets and other transformations via the Java provided
+Transformers.</p>
+
+<h4>Advantages and Disadvantages</h4>
+<p>For representing requests, a Source object is natively supported
+by most of the native Java Transformer APIs. It is useful to get the
+Source object directly in the method, but if the incoming request is not
+XML, JAX-RS runtimes could throw errors trying to parse the request
+entity and not invoke your method. It may be easier to get an
+InputStream and create an InputSource in the resource method so you can
+directly handle error conditions.</p>
+
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>@PUT
+@Path("{id}")
+@Produces("text/xml")
+public Source updateEntry(Source requestSource, @PathParam("id") Integer id)
+    throws SAXException, IOException, ParserConfigurationException, URISyntaxException,
+    TransformerConfigurationException, TransformerException,
+    TransformerFactoryConfigurationError {
+    DOMResult result = new DOMResult();
+    TransformerFactory.newInstance().newTransformer().transform(requestSource, result);
+    Node n = result.getNode();
+    Document doc = (Document)n;
+
+    NodeList nameNodes = doc.getDocumentElement().getElementsByTagName("name");
+    if (nameNodes.getLength() != 1) {
+        throw new WebApplicationException(Response.Status.BAD_REQUEST);
+    }
+
+    NodeList numberNodes = doc.getDocumentElement().getElementsByTagName("number");
+    if (numberNodes.getLength() != 1) {
+        throw new WebApplicationException(Response.Status.BAD_REQUEST);
+    }
+
+    /*
+     * get the phone entry and update
+     */
+    PhoneEntry entry = PhoneBook.getPhoneBook().getEntries().get(id);
+    entry.setName(nameNodes.item(0).getTextContent());
+    entry.setNumber(numberNodes.item(0).getTextContent());
+
+    StringWriter sw = new StringWriter();
+    sw.append("&lt;entry&gt;" + "&lt;href&gt;" + uriInfo.getAbsolutePath() + "&lt;/href&gt;" + "&lt;name&gt;"
+        + entry.getName() + "&lt;/name&gt;" + "&lt;number&gt;" + entry.getNumber() + "&lt;/number&gt;"
+        + "&lt;/entry&gt;");
+    ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(sw.getBuffer()
+        .toString().getBytes());
+    Document responseDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
+        byteArrayInputStream);
+    return new DOMSource(responseDoc);
+}</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+</div>
+
+<p></p>
+</div>
+
+<iframe src="../../footer.html" scrolling="no" frameborder="0"
+	style="width: 100%;"><a href="../../footer.html">Hmm, you are
+using a very old browser. Click here to go directly to included content.</a></iframe>
+</body>
+</html>

Added: incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/testyourapp.html
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/testyourapp.html?rev=787550&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/testyourapp.html (added)
+++ incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/testyourapp.html Tue Jun 23 05:30:05 2009
@@ -0,0 +1,318 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="copyright" content="IBM Corporation 2008">
+<meta name="DC.Rights.Owner" content="IBM Corporation 2008">
+<!-- All rights reserved. Licensed Materials Property of IBM -->
+<!-- US Government Users Restricted Rights -->
+<!-- Use, duplication or disclosure restricted by -->
+<!-- GSA ADP Schedule Contract with IBM Corp. -->
+<link rel="stylesheet" href="book.css" type="text/css">
+<link rel="stylesheet" href="../siteonly/site.css" type="text/css">
+<title>IBM JAX-RS Application Test</title>
+</head>
+<body>
+
+<!-- Header information -->
+<iframe src="header.html" scrolling="no" frameborder="0"
+	style="width: 100%; height: 75px;"> <a href="header.html">If
+you are using a lower-level browser, then click here to go directly to
+included content.</a> </iframe>
+
+<h1>JAX-RS Application Testing Without a Web Server</h1>
+
+<p>This guide will walk you through building up a test framework for your JAX-RS application, without the need for a web server.  It is the fastest way to ensure your JAX-RS application annotations and resource implementations are correct!</p>
+<p>We are building on the <a href="quickstart.html">Hello, World! sample from the Quick Start guide</a>.  This guide requires that you have JUnit3 (or 4) and <a href="http://easymock.org/">EasyMock</a> libraries on the project classpath.</p>
+
+<ol>
+<li>Create a peer directory of your src directory called &quot;test&quot; and designate it a source folder in your Eclipse project
+	<br />
+	<ul>
+		<li>Right-click project -&gt; New -&gt; Source Folder -&gt; (type in &quot;test&quot;) -&gt; OK</li>
+	</ul>
+</li>
+<li>Develop your JUnit testcase class:
+	<ol>
+		<li>Right-click the &quot;test&quot; source folder -> New -> Class
+		<blockquote>
+        As a best practice, you may wish to name your class with "Tests" at the end of your class name and use the same package name as the class being tested.<br />
+        <br />
+        For this example, we will be using JUnit3.  You could just as simply use JUnit4.
+        </blockquote>
+        <ul>
+			<li>Package: org.myorg.jaxrs.sample</li>
+			<li>Class:  HelloWorldApplicationTests</li>
+			<li>Superclass: junit.framework.TestCase</li>
+		</ul>
+		</li>
+		<li>To simulate an inbound request to the servlet, we need several things in place:
+		    <ul>
+		        <li>A RESTServlet object</li>
+		        <li>A ServletConfig object that has the initial params that the web.xml file would normally supply to the servlet container</li>
+		        <li>An HttpServletRequest object that serves up the right request data</li>
+		    </ul>
+		    We achieve this by using &quot;mock&quot; objects, configured in the JUnit3 setup() method.  So far, our class should look like this:
+
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.HttpMethod;
+
+import junit.framework.TestCase;
+
+import com.ibm.ws.jaxrs.web.RESTServlet;
+
+public class HelloWorldApplicationTests extends TestCase {
+
+    private HttpServletRequest request;
+    private ServletConfig config;
+    private RESTServlet servlet;
+    
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        // create mock objects - use Nice because we don't care how many times request
+        // and response methods are called; we are testing our app, not JAX-RS
+        request = createNiceMock(HttpServletRequest.class);
+        config = createNiceMock(ServletConfig.class);
+
+        // mock what you would normally set in the web.xml file
+        expect(config.getInitParameter("javax.ws.rs.Application")).andReturn(
+                "org.myorg.jaxrs.sample.HelloWorldApplication");
+        
+        servlet = new RESTServlet();
+    }
+
+}</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+		<br />	
+		Good so far, but how do we capture the response from our servlet so we can inspect it and verify it?  We need a mock HttpServletResponse object.  More importantly, we need an HttpServletResponse object that writes to a locally accessible Writer so we can pull data from the Writer and verify it.
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.HttpMethod;
+
+import junit.framework.TestCase;
+
+import com.ibm.ws.jaxrs.web.RESTServlet;
+
+public class HelloWorldApplicationTests extends TestCase {
+
+    private HttpServletRequest request;
+    <strong style="color:green;">private HttpServletResponse response;</strong>
+    private ServletConfig config;
+    private RESTServlet servlet;
+    <strong style="color:green;">private MockServletOutputStream sos;</strong>
+    <strong style="color:green;">private StringWriter writer;  // we'll use this writer to get and inspect the servlet response body</strong>
+    
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        // create mock objects - use Nice because we don't care how many times request
+        // and response methods are called; we are testing our app, not JAX-RS
+        request = createNiceMock(HttpServletRequest.class);
+        <strong style="color:green;">response = createNiceMock(HttpServletResponse.class);</strong>
+        config = createNiceMock(ServletConfig.class);
+
+        // mock what you would normally set in the web.xml file
+        expect(config.getInitParameter("javax.ws.rs.Application")).andReturn(
+                "org.myorg.jaxrs.sample.HelloWorldApplication");
+
+        <strong style="color:green;">// set up the mock response object so we can "intercept" and inspect the response message body</strong>
+        <strong style="color:green;">writer = new StringWriter();</strong>
+        <strong style="color:green;">sos = new MockServletOutputStream(writer);</strong>
+        <strong style="color:green;">expect(response.getOutputStream()).andReturn(sos);</strong>
+        
+        servlet = new RESTServlet();
+    }
+    
+    <strong style="color:green;">
+    // we implement our own MockServletOutputStream to simplify the capture of the servlet response
+    public class MockServletOutputStream extends javax.servlet.ServletOutputStream {
+
+        private StringWriter sw;
+
+        public MockServletOutputStream(StringWriter sw) {
+            this.sw = sw;
+        }
+
+        @Override
+        public void write(int b) throws IOException {
+            sw.write(b);
+        }
+
+    }</strong>
+}</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+		<br />
+Now we've got our response object configured to write to a local StringWriter object.  We can grab that object at the end of each test method and inspect it for the data we expect.  Let's write a test!
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>    public void testHTTPGet() throws Exception {
+
+        // set up the mock request object
+        expect(request.getMethod()).andReturn(HttpMethod.GET);
+        // getRequestURL may be called multiple times in JAX-RS engine, hence
+        // we need to configure expectations to allow it to be called many times.
+        expect(request.getRequestURL()).andReturn(
+                new StringBuffer("/helloworld")).anyTimes();
+        expect(request.getContextPath()).andReturn("");
+        
+        // turn on the EasyMock checking and behavior expectations
+        replay(request);
+        replay(response);
+        replay(config);
+
+        // initialize the servlet just like the servlet container would
+        servlet.init(config);
+        
+        // execute the test
+        servlet.doGet(request, response);
+
+        // let EasyMock check that the behavior expectations are satisfied (in this example, the expectations are loosely defined)
+        verify(request);
+
+        // get the output stream buffer and verify the contents
+        StringBuffer buffer = writer.getBuffer();
+        assertEquals("Hello, World!", buffer.toString());
+
+    }</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+		<br />
+That's all there is to it!  We've tested our full application, annotation processing and all, without ever starting up a web server.<br />
+<br />
+Let's extend our example a little bit.  Let's say our Hello, World! application resource also supports a @POST method that simply echos what it receives:
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>	@POST
+	public String helloWorldPost(String in) {
+	    return in;
+	}</code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+		<br />
+		This presents a little bit of a challenge.  We now need to send data via our HttpServletRequest object.  No problem!  We'll mock it up in much the same way as the HttpServletResponse object.  Here is our new test, and our nested implementation class for ServletInputStream:
+<table border="0" width="100%">
+	<tbody>
+		<tr>
+			<td class="code-outline">
+			<div><pre><code>    public void testHTTPPost() throws Exception {
+
+        // set up the mock request object
+        expect(request.getMethod()).andReturn(HttpMethod.POST);  <strong style="color:green;">// note: POST instead of GET</strong>
+        // getRequestURL may be called multiple times in JAX-RS engine, hence
+        // we need to configure expectations to allow it to be called many times.
+        expect(request.getRequestURL()).andReturn(
+                new StringBuffer("/helloworld")).anyTimes();
+        expect(request.getContextPath()).andReturn("");
+        <strong style="color:green;">// make sure the input stream carries the data we intend to be passed as the query
+        expect(request.getInputStream()).andReturn(
+                new MockServletInputStream(new ByteArrayInputStream(
+                        "Echo of Hello, World!".getBytes())));</strong>
+
+        // turn on the EasyMock checking
+        replay(request);
+        replay(response);
+        replay(config);
+
+        servlet.init(config);
+
+        // execute the test <strong style="color:green;">(note: doPost instead of doGet)</strong>
+        servlet.doPost(request, response);
+
+        // let EasyMock check that the behavior expectations are satisfied (in this example, the expectations are loosely defined)
+        verify(request);
+
+        // get the output stream buffer and verify the contents
+        StringBuffer buffer = writer.getBuffer();
+        assertEquals("Echo of Hello, World!", buffer.toString());
+
+    }
+
+    <strong style="color:green;">public class MockServletInputStream extends javax.servlet.ServletInputStream {
+
+        private InputStream content;
+
+        public MockServletInputStream(InputStream is) {
+            content = is;
+        }
+
+        @Override
+        public int read() throws IOException {
+            return content.read();
+        }
+
+    }</strong></code></pre></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+
+	</li>
+	</ol>
+</li>
+
+
+<li>That's it!  This is the fastest way to test that your annotations, code, and infrastructure are configured and implemented as you expect.  You can execute this test just as you would any other JUnit test!</li>
+
+</ol>
+
+<h2>Notes</h2>
+
+<ul>
+<li>You may wish to implement your own mock object class that extends HttpServletResponse to have a &quot;getStatus()&quot; method so you can inspect the HTTP response codes.</li>
+<li>JMock did not cooperate with me quite as quickly and easily as EasyMock did.  JMock mock objects require hard expectations (such as declaring exactly two method calls), but could not count the method calls properly when done on a separate thread.  Since a servlet invocation always occurs on its own thread, this is a problem.  Hence, EasyMock, with its less restrictive expectations.</li>
+</ul>
+
+<!-- Footer information -->
+<iframe src="footer.html" scrolling="no" frameborder="0"
+	style="width: 100%;"> <a href="footer.html">If you are
+using a lower-level browser, then click here to go directly to included
+content.</a> </iframe>
+
+</body>
+</html>
\ No newline at end of file

Added: incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/whatisjaxrs.html
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/whatisjaxrs.html?rev=787550&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/whatisjaxrs.html (added)
+++ incubator/wink/contrib/ibm-jaxrs/resources/docs/site/en/whatisjaxrs.html Tue Jun 23 05:30:05 2009
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="copyright" content="IBM Corporation 2008">
+<meta name="DC.Rights.Owner" content="IBM Corporation 2008">
+<!-- All rights reserved. Licensed Materials Property of IBM -->
+<!-- US Government Users Restricted Rights -->
+<!-- Use, duplication or disclosure restricted by -->
+<!-- GSA ADP Schedule Contract with IBM Corp. -->
+<link rel="stylesheet" href="book.css" type="text/css">
+<link rel="stylesheet" href="../siteonly/site.css" type="text/css">
+<title>IBM JAX-RS</title>
+</head>
+<body>
+
+<!-- Header information -->
+<iframe src="header.html" scrolling="no" frameborder="0"
+	style="width: 100%; height: 75px;"> <a href="header.html">If
+you are using a lower-level browser, then click here to go directly to
+included content.</a> </iframe>
+
+<h1>What is JAX-RS</h1>
+
+<font color="red">Add more JAX-RS background here.</font>
+
+
+<!-- Footer information -->
+<iframe src="footer.html" scrolling="no" frameborder="0"
+	style="width: 100%;"> <a href="footer.html">If you are
+using a lower-level browser, then click here to go directly to included
+content.</a> </iframe>
+
+</body>
+</html>
\ No newline at end of file

Added: incubator/wink/contrib/ibm-jaxrs/resources/docs/site/index.html
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/resources/docs/site/index.html?rev=787550&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/resources/docs/site/index.html (added)
+++ incubator/wink/contrib/ibm-jaxrs/resources/docs/site/index.html Tue Jun 23 05:30:05 2009
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<script>
+	//try and determine what language the browser is running in to redirect 
+	//to the right page.
+	var lang = "en";
+	var locale = navigator.language ? navigator.language
+			: navigator.userLanguage;
+
+	function startsWith(str, frag) {
+		if (str.indexOf(frag) === 0) {
+			return true;
+		}
+		return false;
+	}
+
+	if (locale) {
+		locale = locale.toLowerCase();
+		if (startsWith(locale, "es-")) {
+			lang = "[es]";
+		} else if (startsWith(locale, "de-")) {
+			lang = "[de]";
+		} else if (startsWith(locale, "it-")) {
+			lang = "[it]";
+		} else if (startsWith(locale, "tr-")) {
+			lang = "[tr]";
+		} else if (startsWith(locale, "cs-")) {
+			lang = "[cs]";
+		} else if (startsWith(locale, "pl-")) {
+			lang = "[pl]";
+		} else if (startsWith(locale, "pt-br")) {
+			lang = "[pt-br]";
+		} else if (startsWith(locale, "pt-")) {
+			lang = "[pt]";
+		} else if (startsWith(locale, "fr-")) {
+			lang = "[fr]";
+		} else if (startsWith(locale, "ko-")) {
+			lang = "[ko]";
+		} else if (startsWith(locale, "zh-tw")) {
+			lang = "[zh-tw]";
+		} else if (startsWith(locale, "zh-")) {
+			lang = "[zh]";
+		} else if (startsWith(locale, "ja-")) {
+			lang = "[ja]";
+		}
+
+		if (startsWith(locale, "[")) {
+			lang = "en";
+		}
+	}
+	var docPage = lang + "/index.html";
+	window.location.href = docPage;
+</script>
+</head>
+<body>
+</body>
+</html>

Added: incubator/wink/contrib/ibm-jaxrs/resources/eclipse/eclipse-classpath
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/resources/eclipse/eclipse-classpath?rev=787550&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/resources/eclipse/eclipse-classpath (added)
+++ incubator/wink/contrib/ibm-jaxrs/resources/eclipse/eclipse-classpath Tue Jun 23 05:30:05 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="tests/unittests"/>
+	<classpathentry kind="src" path="tests/fvt"/>
+	<classpathentry kind="src" output="samples/addressBook/build/classes/server" path="samples/addressBook/server/src"/>
+	<classpathentry kind="src" path="samples/common/src"/>
+	<classpathentry kind="src" output="samples/guestbook/build/classes/server" path="samples/guestbook/server/src"/>
+	<classpathentry kind="src" path="samples/helloWorld/server/src"/>
+	<classpathentry kind="src" path="samples/json/server/src"/>
+	<classpathentry kind="src" output="samples/organization/build/classes/client" path="samples/organization/client/src"/>
+	<classpathentry kind="src" output="samples/organization/build/classes/server" path="samples/organization/server/src"/>
+	<classpathentry kind="src" path="samples/providers/server/src"/>
+	<classpathentry kind="src" path="samples/xml/server/src"/>
+	<classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
+	<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
+	<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
+	<classpathentry kind="lib" path="lib/geronimo-annotation_1.0_spec-1.1.1.jar"/>
+	<classpathentry kind="lib" path="lib/geronimo-servlet_3.0_spec-1.0-EA-20080711.180136-1.jar"/>
+	<classpathentry kind="lib" path="lib/jetty-6.1.9.jar"/>
+	<classpathentry kind="lib" path="lib/jetty-util-6.1.9.jar"/>
+	<classpathentry kind="lib" path="lib/jsr311-api-0.11.jar"/>
+	<classpathentry kind="lib" path="lib/junit-4.4.jar"/>
+	<classpathentry kind="lib" path="lib/xmlbeans-2.3.0.jar"/>
+	<classpathentry kind="lib" path="lib/abdera-0.4.0-incubating.jar"/>
+	<classpathentry kind="lib" path="lib/axiom-impl-1.2.5.jar"/>
+	<classpathentry kind="lib" path="lib/axiom-api-1.2.5.jar"/>
+	<classpathentry kind="lib" path="lib/jaxen-1.1.1.jar"/>
+	<classpathentry kind="output" path="build/classes"/>
+</classpath>
\ No newline at end of file

Added: incubator/wink/contrib/ibm-jaxrs/resources/eclipse/eclipse_code_format_apache.xml
URL: http://svn.apache.org/viewvc/incubator/wink/contrib/ibm-jaxrs/resources/eclipse/eclipse_code_format_apache.xml?rev=787550&view=auto
==============================================================================
--- incubator/wink/contrib/ibm-jaxrs/resources/eclipse/eclipse_code_format_apache.xml (added)
+++ incubator/wink/contrib/ibm-jaxrs/resources/eclipse/eclipse_code_format_apache.xml Tue Jun 23 05:30:05 2009
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8"?><profiles version="11">
+<profile kind="CodeFormatterProfile" name="Apache Format" version="11">
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+</profile>
+</profiles>
\ No newline at end of file



Mime
View raw message