You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by bu...@apache.org on 2011/11/19 16:40:08 UTC

svn commit: r798921 - /websites/staging/opennlp/trunk/content/opennlp/code-conventions.html

Author: buildbot
Date: Sat Nov 19 15:40:08 2011
New Revision: 798921

Log:
Staging update by buildbot

Added:
    websites/staging/opennlp/trunk/content/opennlp/code-conventions.html

Added: websites/staging/opennlp/trunk/content/opennlp/code-conventions.html
==============================================================================
--- websites/staging/opennlp/trunk/content/opennlp/code-conventions.html (added)
+++ websites/staging/opennlp/trunk/content/opennlp/code-conventions.html Sat Nov 19 15:40:08 2011
@@ -0,0 +1,118 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<head>
+  <link href="/opennlp/css/opennlp.css" rel="stylesheet" type="text/css">
+  <title>Apache OpenNLP - Apache OpenNLP Code Conventions</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <meta http-equiv="Content-Language" content="en">
+  <meta name="description" content="Apache OpenNLP is a Java machine learning toolkit for natural language processing (NLP). 
+    It supports the most common NLP tasks.">
+</head>
+
+<body>
+  <div id="banner">
+    <img id="opennlp-logo" title="Apache OpenNLP" width="300" height="75" src="/opennlp/images/onlplogo.jpg" alt="Apache OpenNLP">
+    <a id="apache-incubator-logo" title="Apache incubator" href="http://incubator.apache.org/">
+      <img src="http://incubator.apache.org/images/apache-incubator-logo.png" alt="Apache Incubator" border="0">
+    </a>   
+  </div>
+
+  <div id="navigation">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="index.html">Home</a></li>
+<li><a href="download.cgi">Download</a></li>
+<li><a href="maven-dependency.html">Maven Dependency</a></li>
+<li><a href="http://www.apache.org/licenses/" class="externalLink">License</a></li>
+<li><a href="documentation.html">Documentation</a></li>
+<li><a href="news.html">News</a></li>
+<li><a href="mail-lists.html">Mailing Lists</a></li>
+<li><a href="https://issues.apache.org/jira/browse/OPENNLP" class="externalLink">Issue tracker</a></li>
+<li><a href="https://cwiki.apache.org/OPENNLP" class="externalLink">Wiki</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="source-code.html">Source Code</a></li>
+<li><a href="building.html">Building</a></li>
+<li><a href="release.html">Making a release</a></li>
+<li><a href="team.html">Project Team</a></li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org" class="externalLink">ASF</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink">Become a Sponsor</a></li>
+</ul>
+  </div>
+  
+  <div id="content">
+    <h1 class="title">Apache OpenNLP Code Conventions</h1>
+    <p>The Apache OpenNLP code should follow our code conventions. All code which
+is contributed to the project should adhere to these guidelines. </p>
+<ul>
+<li>Use 2 spaces for indentation. No tabs!</li>
+<li>Place open braces on the same line as the declaration, for example:
+<pre><code>
+public class Foo extends Bar {
+  public static void main(String args[]) {
+    try {
+      for (int i = 0; i &lt; args.length; i++) {
+        System.out.println(Integer.parseInt(args[i]));
+      }           <br />
+    }
+    catch(NumberFormatException e) {
+      e.printStackTrace();
+    }
+  }
+}
+</code></pre></li>
+<li>Wrap lines longer than 80 to 100 characters. For wrapped lines use an indent of 8 characters.</li>
+<li>Within a class or interface, definitions should be ordered as follows:</li>
+<li>Inner classses</li>
+<li>Class (static) variables</li>
+<li>Instance variables</li>
+<li>Constructors</li>
+<li>
+<p>Methods</p>
+</li>
+<li>
+<p>Do not use package imports (for example import org.apache.opennlp.*)</p>
+</li>
+<li>For other cases, we try to follow Java code conventions as much as possible: see http://www.oracle.com/technetwork/java/codeconv-138413.html</li>
+</ul>
+  </div>
+  
+  <div class="clear">
+    <hr>
+  </div>
+    
+  <div id="footer">
+    <div class="copyright">
+      <p>
+        Copyright &copy; 2010 The Apache Software Foundation, Licensed under 
+        the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+        <br>
+        Apache and the Apache feather logo are trademarks of The Apache Software Foundation.
+      </p>
+    </div>
+  </div>
+</body>
+</html>