You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2015/09/25 23:10:23 UTC
svn commit: r1705356 - in /sis:
branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/
site/trunk/book/en/ site/trunk/book/fr/ site/trunk/content/book/
site/trunk/content/book/en/ site/trunk/content/book/fr/
Author: desruisseaux
Date: Fri Sep 25 21:10:23 2015
New Revision: 1705356
URL: http://svn.apache.org/viewvc?rev=1705356&view=rev
Log:
Put comments in light gray and quoted strings in italic.
Modified:
sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java
sis/site/trunk/book/en/geoapi.html
sis/site/trunk/book/en/utility.html
sis/site/trunk/book/en/xml.html
sis/site/trunk/book/fr/geoapi.html
sis/site/trunk/book/fr/utility.html
sis/site/trunk/book/fr/xml.html
sis/site/trunk/content/book/book.css
sis/site/trunk/content/book/en/developer-guide.html
sis/site/trunk/content/book/fr/developer-guide.html
Modified: sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java [UTF-8] Fri Sep 25 21:10:23 2015
@@ -305,7 +305,7 @@ public final class Assembler {
break;
}
case "pre": {
- colorizer.highlight(node, false);
+ colorizer.highlight(node, ((Element) node).getAttribute("class"));
break;
}
default: {
Modified: sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/CodeColorizer.java [UTF-8] Fri Sep 25 21:10:23 2015
@@ -82,15 +82,46 @@ public final class CodeColorizer {
/**
* Applies emphasing on the words found in all text node of the given node.
*
- * @param parent the root element where to put Java keywords in bold characters.
- * This is typically a {@code <pre>} or {@code <code>} element.
- * @param isInsideQuotes if the text begin inside a quoted text.
+ * @param parent the root element where to put Java keywords in bold characters.
+ * This is typically a {@code <pre>} or {@code <code>} element.
+ * @param type {@code "xml"} if the element to process is XML rather than Java code.
+ * @throws BookException if an element can not be processed.
*/
- public void highlight(final Node parent, boolean isInsideQuotes) {
+ public void highlight(final Node parent, final String type) throws BookException {
+ final boolean isXML = "xml".equals(type);
+ final boolean isJava = !isXML; // Future version may add more choices.
+ Element syntaticElement = null; // E.g. comment block or a String.
+ String stopCondition = null; // Identify 'syntaticElement' end.
for (final Node node : toArray(parent.getChildNodes())) {
+ /*
+ * The following condition happen only if a quoted string or a comment started in a previous
+ * node and is continuing in the current node. In such case we need to transfer everything we
+ * found into the 'syntaticElement' node, until we found the 'stopCondition'.
+ */
+ if (stopCondition != null) {
+ if (node.getNodeType() != Node.TEXT_NODE) {
+ syntaticElement.appendChild(node); // Also remove from its previous position.
+ continue;
+ }
+ final String text = node.getTextContent();
+ int lower = text.indexOf(stopCondition);
+ if (lower >= 0) {
+ lower += stopCondition.length();
+ stopCondition = null;
+ } else {
+ lower = text.length();
+ }
+ syntaticElement.appendChild(document.createTextNode(text.substring(0, lower)));
+ node.setTextContent(text.substring(lower));
+ // Continue below in case there is some remaining characters to analyse.
+ }
+ /*
+ * The following is the usual code path where we search for Java keywords, OGC/ISO, GeoAPI and SIS
+ * identifiers, and where the quoted strings and the comments are recognized.
+ */
switch (node.getNodeType()) {
case Node.ELEMENT_NODE: {
- highlight(node, isInsideQuotes);
+ highlight(node, type);
break;
}
case Node.TEXT_NODE: {
@@ -98,11 +129,46 @@ public final class CodeColorizer {
int nextSubstringStart = 0, lower = 0;
while (lower < text.length()) {
int c = text.codePointAt(lower);
- if (isInsideQuotes || !Character.isJavaIdentifierStart(c)) {
+ if (!Character.isJavaIdentifierStart(c)) {
if (c == '"') {
- isInsideQuotes = !isInsideQuotes;
+ stopCondition = "\"";
+ syntaticElement = document.createElement("i");
+ } else if (isJava && text.regionMatches(lower, "/*", 0, 2)) {
+ stopCondition = "*/";
+ syntaticElement = document.createElement("code");
+ syntaticElement.setAttribute("class", "comment");
+ } else if (isJava && text.regionMatches(lower, "//", 0, 2)) {
+ stopCondition = "\n";
+ syntaticElement = document.createElement("code");
+ syntaticElement.setAttribute("class", "comment");
+ } else if (isXML && text.regionMatches(lower, "<!--", 0, 4)) {
+ stopCondition = "-->";
+ syntaticElement = document.createElement("code");
+ syntaticElement.setAttribute("class", "comment");
+ } else {
+ lower += Character.charCount(c);
+ continue; // "Ordinary" character: scan next characters.
+ }
+ /*
+ * Found the begining of a comment block or a string. Search where that block ends
+ * (it may be in another node) and store all text between the current position and
+ * the end into 'syntaticElement'.
+ */
+ if (nextSubstringStart != lower) {
+ parent.insertBefore(document.createTextNode(text.substring(nextSubstringStart, lower)), node);
+ }
+ nextSubstringStart = lower;
+ lower = text.indexOf(stopCondition, lower+1);
+ if (lower >= 0) {
+ lower += stopCondition.length();
+ stopCondition = null;
+ } else {
+ lower = text.length();
+ // Keep stopCondition; we will need to search for it in next nodes.
}
- lower += Character.charCount(c);
+ syntaticElement.setTextContent(text.substring(nextSubstringStart, lower));
+ parent.insertBefore(syntaticElement, node);
+ nextSubstringStart = lower;
} else {
/*
* Found the beginning of a Java identifier. Search where it ends.
Modified: sis/site/trunk/book/en/geoapi.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/book/en/geoapi.html?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/book/en/geoapi.html (original)
+++ sis/site/trunk/book/en/geoapi.html Fri Sep 25 21:10:23 2015
@@ -230,19 +230,19 @@
</p>
<pre>package <code class="GeoAPI">org.opengis.referencing.crs</code>;
-<code class="comment">
+
/**
* A 2D coordinate reference system used to approximate the shape of the earth on a planar surface.
- */</code>
-<code class="GeoAPI">@UML</code>(<var>specification</var> = ISO_19111,
- <var>identifier</var> = "<code class="OGC">SC_ProjectedCRS</code>")
-public interface <code class="GeoAPI">ProjectedCRS</code> extends <code class="GeoAPI">GeneralDerivedCRS</code> {<code class="comment">
+ */
+<code class="GeoAPI">@UML</code>(specification = ISO_19111,
+ identifier = "<code class="OGC">SC_ProjectedCRS</code>")
+public interface <code class="GeoAPI">ProjectedCRS</code> extends <code class="GeoAPI">GeneralDerivedCRS</code> {
/**
* Returns the coordinate system, which must be Cartesian.
- */</code>
- <code class="GeoAPI">@UML</code>(<var>obligation</var> = MANDATORY,
- <var>specification</var> = ISO_19111,
- <var>identifier</var> = "<code class="OGC">coordinateSystem</code>")
+ */
+ <code class="GeoAPI">@UML</code>(obligation = MANDATORY,
+ specification = ISO_19111,
+ identifier = "<code class="OGC">coordinateSystem</code>")
<code class="GeoAPI">CartesianCS getCoordinateSystem()</code>;
}</pre>
@@ -253,11 +253,11 @@ public interface <code class="GeoAPI">Pr
The following example displays the standard name for the method <code class="GeoAPI">getTitle()</code> from the <code class="GeoAPI">Citation</code> interface:
</p>
-<pre>Class<?> <var>type</var> = <code class="GeoAPI">Citation</code>.class;
-Method <var>method</var> = <var>type</var>.getMethod("<code class="GeoAPI">getTitle</code>", (Class<?>[]) null);
-<code class="GeoAPI">UML</code> <var>annot</var> = <var>method</var>.getAnnotation(<code class="GeoAPI">UML</code>.class);
-String <var>id</var> = <var>annot</var>.identifier();
-System.out.println("The standard name for the " + <var>method</var>.getName() + " method is " + <var>id</var>);</pre>
+<pre>Class<?> type = <code class="GeoAPI">Citation</code>.class;
+Method method = type.getMethod("<code class="GeoAPI">getTitle</code>", (Class<?>[]) null);
+<code class="GeoAPI">UML</code> annot = method.getAnnotation(<code class="GeoAPI">UML</code>.class);
+String id = annot.identifier();
+System.out.println("The standard name for the " + method.getName() + " method is " + id);</pre>
<p>
The class <code class="SIS">org.apache.sis.util.iso.Types</code> provides the
@@ -271,14 +271,14 @@ System.out.println("The standard name fo
Users are always encouraged to only read this file once and then save its contents in their application's cache.
</p>
-<pre>Properties <var>isoToGeoAPI</var> = new Properties();
+<pre>Properties isoToGeoAPI = new Properties();
try (InputStream in = <code class="GeoAPI">UML</code>.class.getResourceAsStream("<code class="GeoAPI">class-index.properties</code>")) {
- <var>isoToGeoAPI</var>.load(in);
+ isoToGeoAPI.load(in);
}
-String <var>isoName</var> = "<code class="OGC">CI_Citation</code>";
-String <var>geoName</var> = getProperty(<var>isoName</var>);
-Class<?> <var>type</var> = Class.forName(<var>geoName</var>);
-System.out.println("The GeoAPI interface for <abbr>ISO</abbr> type " + <var>isoName</var> + " is " + <var>type</var>);</pre>
+String isoName = "<code class="OGC">CI_Citation</code>";
+String geoName = getProperty(isoName);
+Class<?> type = Class.forName(geoName);
+System.out.println("The GeoAPI interface for <abbr>ISO</abbr> type " + isoName + " is " + type);</pre>
<p>
The class <code class="SIS">org.apache.sis.util.iso.Types</code> provides the
@@ -465,10 +465,10 @@ System.out.println("The GeoAPI interface
creates new instances if the name provided does not correspond to the name of an existing instance.
</p>
-<pre><code class="GeoAPI">MediumName</code> <var>cdRom</var> = <code class="GeoAPI">MediumName.CD_ROM;</code>
-<code class="GeoAPI">MediumName</code> <var>usbKey</var> = <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>"); <code class="comment">// There is no constraint on this value.</code>
-assert <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">CD_ROM</code>") == <var>cdRom</var> : "valueOf must return existing constants.";
-assert <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>") == <var>usbKey</var> : "valueOf must cache the previously requested values.";</pre>
+<pre><code class="GeoAPI">MediumName</code> cdRom = <code class="GeoAPI">MediumName.CD_ROM;</code>
+<code class="GeoAPI">MediumName</code> usbKey = <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>"); // There is no constraint on this value.
+assert <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">CD_ROM</code>") == cdRom : "valueOf must return existing constants.";
+assert <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>") == usbKey : "valueOf must cache the previously requested values.";</pre>
@@ -499,9 +499,9 @@ import java.util.ServiceLoader;
public class MyApplication {
public void createMyDatum() {
- ServiceLoader <var>loader</var> = ServiceLoader.load(<code class="GeoAPI">DatumFactory</code>.class);
- <code class="GeoAPI">DatumFactory</code> <var>factory</var> = <var>loader</var>.iterator().next();
- <code class="GeoAPI">GeodeticDatum</code> <var>myDatum</var> = <var>factory</var>.<code class="GeoAPI">createGeodeticDatum</code>(â¦);
+ ServiceLoader loader = ServiceLoader.load(<code class="GeoAPI">DatumFactory</code>.class);
+ <code class="GeoAPI">DatumFactory</code> factory = loader.iterator().next();
+ <code class="GeoAPI">GeodeticDatum</code> myDatum = factory.<code class="GeoAPI">createGeodeticDatum</code>(â¦);
}
}</pre>
@@ -694,13 +694,13 @@ public class MyApplication {
import <code class="GeoAPI">org.opengis.test.Validators</code>;
import org.junit.Test;
-public class MyTest {<code class="comment">
+public class MyTest {
/*
* Tolerate the absence of mandatory attributes in metadata and citation packages.
* This modification applies to all tests executed by the currently running <abbr>JVM</abbr>.
* If there are multiple test classes, this initialization may be performed
* in a parent class to all test classes.
- */</code>
+ */
static {
<code class="GeoAPI">Validators.DEFAULT.metadata.requireMandatoryAttributes</code> = false;
<code class="GeoAPI">Validators.DEFAULT.citation.requireMandatoryAttributes</code> = false;
@@ -708,8 +708,8 @@ public class MyTest {<code class="commen
@Test
public void testMyMetadata() {
- <code class="GeoAPI">Metadata</code> <var>myObject</var> = â¦; <code class="comment">// Create an object here.</code>
- <code class="GeoAPI">Validators.validate</code>(<var>myObject</var>);
+ <code class="GeoAPI">Metadata</code> myObject = â¦; // Create an object here.
+ <code class="GeoAPI">Validators.validate</code>(myObject);
}
}</pre>
@@ -723,18 +723,18 @@ import <code class="GeoAPI">org.opengis.
import org.junit.Test;
public class MyTest {
- private final <code class="GeoAPI">ValidatorContainer</code> <var>validators</var>;
+ private final <code class="GeoAPI">ValidatorContainer</code> validators;
public MyTest() {
- <var>validators</var> = new <code class="GeoAPI">ValidatorContainer()</code>;
- <var>validators</var>.<code class="GeoAPI">metadata.requireMandatoryAttributes</code> = false;
- <var>validators</var>.<code class="GeoAPI">citation.requireMandatoryAttributes</code> = false;
+ validators = new <code class="GeoAPI">ValidatorContainer()</code>;
+ validators.<code class="GeoAPI">metadata.requireMandatoryAttributes</code> = false;
+ validators.<code class="GeoAPI">citation.requireMandatoryAttributes</code> = false;
}
@Test
public void testMyMetadata() {
- <code class="GeoAPI">Metadata</code> <var>myObject</var> = â¦; <code class="comment">// Create an object here.</code>
- <var>validators</var>.<code class="GeoAPI">validate</code>(<var>myObject</var>);
+ <code class="GeoAPI">Metadata</code> myObject = â¦; // Create an object here.
+ validators.<code class="GeoAPI">validate</code>(myObject);
}
}</pre>
@@ -762,35 +762,35 @@ import <code class="GeoAPI">org.opengis.
import static org.junit.Assert.*;
@RunWith(JUnit4.class)
-public class MyTest extends <code class="GeoAPI">ParameterizedTransformTest</code> {<code class="comment">
+public class MyTest extends <code class="GeoAPI">ParameterizedTransformTest</code> {
/**
* Specify our own coordinate transformation factory for the GeoAPI tests.
* GeoAPI will test the objects created by this factory.
- */</code>
+ */
public MyTest() {
super(new MyMathTransformFactory());
}
-<code class="comment">
+
/**
* Changes the behaviour of a test. This example relaxes the requirements of this test a little,
* by accepting errors of up to 10 centimetres, rather than the default value of 1 cm.
* This change only applies to this method, and does not affect the other inherited tests.
- */</code>
+ */
@Test
@Override
public void testLambertAzimuthalEqualArea() throws <code class="GeoAPI">FactoryException</code>, <code class="GeoAPI">TransformException</code> {
- <code class="GeoAPI"><var>tolerance</var></code> = 0.1; // 10 cm tolerance.
+ <code class="GeoAPI">tolerance</code> = 0.1; // 10 cm tolerance.
super.<code class="GeoAPI">testLambertAzimuthalEqualArea()</code>;
}
-<code class="comment">
+
/**
* Supplemental verification performed after each test, inherited or not.
* In this example, we are verifying that the transformation tested
* works correctly in two-dimensional spaces.
- */</code>
+ */
@After
public void ensureAllTransformAreMath2D() {
- assertTrue(<code class="GeoAPI"><var>transform</var></code> instanceof <code class="GeoAPI">MathTransform2D</code>);
+ assertTrue(<code class="GeoAPI">transform</code> instanceof <code class="GeoAPI">MathTransform2D</code>);
}
}</pre>
Modified: sis/site/trunk/book/en/utility.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/book/en/utility.html?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/book/en/utility.html (original)
+++ sis/site/trunk/book/en/utility.html Fri Sep 25 21:10:23 2015
@@ -232,20 +232,20 @@
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt">for (int <var>i</var>=0; <var>i</var><<var>string</var>.length(); <var>i</var>++) {
- char <var>c</var> = <var>string</var>.charAt(<var>i</var>);
- if (Character.isWhitespace(<var>c</var>)) {
- <code class="comment">// A blank space was found.</code>
+<pre style="margin-top: 6pt">for (int i=0; i<string.length(); i++) {
+ char c = string.charAt(i);
+ if (Character.isWhitespace(c)) {
+ // A blank space was found.
}
}</pre>
</td>
<td>
-<pre style="margin-top: 6pt">for (int <var>i</var>=0; <var>i</var><<var>string</var>.length();) {
- int <var>c</var> = <var>string</var>.codePointAt(<var>i</var>);
- if (Character.isWhitespace(<var>c</var>)) {
- <code class="comment">// A blank space was found.</code>
+<pre style="margin-top: 6pt">for (int i=0; i<string.length();) {
+ int c = string.codePointAt(i);
+ if (Character.isWhitespace(c)) {
+ // A blank space was found.
}
- <var>i</var> += Character.charCount(<var>c</var>);
+ i += Character.charCount(c);
}</pre>
</td>
</tr>
Modified: sis/site/trunk/book/en/xml.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/book/en/xml.html?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/book/en/xml.html (original)
+++ sis/site/trunk/book/en/xml.html Fri Sep 25 21:10:23 2015
@@ -137,7 +137,8 @@
This practice doubles the depth of the hierarchy, and introduces duplication at all levels for each value,
as in the following example:
</p>
-<pre><b><MD_Metadata></b>
+
+<pre class="xml"><b><MD_Metadata></b>
<identificationInfo>
<b><MD_DataIdentification></b>
<citation>
@@ -237,16 +238,16 @@
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><MD_MetaData>
+<pre class="xml" style="margin-top: 6pt"><MD_MetaData>
<identificationInfo>
<MD_DataIdentification id="<b>my_id</b>">
- <code class="comment"><!-- insert child properties here --></code>
+ <!-- insert child properties here -->
</MD_DataIdentification>
</identificationInfo>
</MD_MetaData></pre>
</td>
<td>
-<pre style="margin-top: 6pt"><MD_MetaData>
+<pre class="xml" style="margin-top: 6pt"><MD_MetaData>
<identificationInfo idref="<b>my_id</b>"/>
</MD_MetaData></pre>
</td>
@@ -286,9 +287,9 @@ import java.util.UUID;
public class MyClass {
public void myMethod() {
- UUID <var>identifier</var> = UUID.randomUUID();
- <code class="SIS">DefaultMetadata</code> <var>metadata</var> = new <code class="SIS">DefaultMetadata</code>();
- <var>metadata</var>.<code class="SIS">getIdentifierMap().putSpecialized</code>(<code class="SIS">IdentifierSpace.UUID</code>, <var>identifier</var>);
+ UUID identifier = UUID.randomUUID();
+ <code class="SIS">DefaultMetadata</code> metadata = new <code class="SIS">DefaultMetadata</code>();
+ metadata.<code class="SIS">getIdentifierMap().putSpecialized</code>(<code class="SIS">IdentifierSpace.UUID</code>, identifier);
}
}</pre>
@@ -339,16 +340,16 @@ public class MyClass {
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><CI_Citation>
+<pre class="xml" style="margin-top: 6pt"><CI_Citation>
<series>
<CI_Series>
- <code class="comment"><!-- insert child properties here --></code>
+ <!-- insert child properties here -->
</CI_Series>
</series>
</CI_Citation></pre>
</td>
<td>
-<pre style="margin-top: 6pt"><CI_Citation>
+<pre class="xml" style="margin-top: 6pt"><CI_Citation>
<series nilReason="unknown"/>
</CI_Citation></pre>
</td>
Modified: sis/site/trunk/book/fr/geoapi.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/book/fr/geoapi.html?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/book/fr/geoapi.html (original)
+++ sis/site/trunk/book/fr/geoapi.html Fri Sep 25 21:10:23 2015
@@ -238,19 +238,18 @@
</p>
<pre>package <code class="GeoAPI">org.opengis.referencing.crs</code>;
-<code class="comment">
/**
* A 2D coordinate reference system used to approximate the shape of the earth on a planar surface.
- */</code>
-<code class="GeoAPI">@UML</code>(<var>specification</var> = ISO_19111,
- <var>identifier</var> = "<code class="OGC">SC_ProjectedCRS</code>")
-public interface <code class="GeoAPI">ProjectedCRS</code> extends <code class="GeoAPI">GeneralDerivedCRS</code> {<code class="comment">
+ */
+<code class="GeoAPI">@UML</code>(specification = ISO_19111,
+ identifier = "<code class="OGC">SC_ProjectedCRS</code>")
+public interface <code class="GeoAPI">ProjectedCRS</code> extends <code class="GeoAPI">GeneralDerivedCRS</code> {
/**
* Returns the coordinate system, which must be Cartesian.
- */</code>
- <code class="GeoAPI">@UML</code>(<var>obligation</var> = MANDATORY,
- <var>specification</var> = ISO_19111,
- <var>identifier</var> = "<code class="OGC">coordinateSystem</code>")
+ */
+ <code class="GeoAPI">@UML</code>(obligation = MANDATORY,
+ specification = ISO_19111,
+ identifier = "<code class="OGC">coordinateSystem</code>")
<code class="GeoAPI">CartesianCS getCoordinateSystem()</code>;
}</pre>
@@ -261,11 +260,11 @@ public interface <code class="GeoAPI">Pr
méthode <code class="GeoAPI">getTitle()</code> de lâinterface <code class="GeoAPI">Citation</code>:
</p>
-<pre>Class<?> <var>type</var> = <code class="GeoAPI">Citation</code>.class;
-Method <var>method</var> = <var>type</var>.getMethod("<code class="GeoAPI">getTitle</code>", (Class<?>[]) null);
-<code class="GeoAPI">UML</code> <var>annot</var> = <var>method</var>.getAnnotation(<code class="GeoAPI">UML</code>.class);
-String <var>id</var> = <var>annot</var>.identifier();
-System.out.println("Le nom standard de la méthode " + <var>method</var>.getName() + " est " + <var>id</var>);</pre>
+<pre>Class<?> type = <code class="GeoAPI">Citation</code>.class;
+Method method = type.getMethod("<code class="GeoAPI">getTitle</code>", (Class<?>[]) null);
+<code class="GeoAPI">UML</code> annot = method.getAnnotation(<code class="GeoAPI">UML</code>.class);
+String id = annot.identifier();
+System.out.println("Le nom standard de la méthode " + method.getName() + " est " + id);</pre>
<p>
La classe <code class="SIS">org.apache.sis.util.iso.Types</code> fournit la méthode de commodité
@@ -281,14 +280,14 @@ System.out.println("Le nom standard de l
une cache de leur application.
</p>
-<pre>Properties <var>isoToGeoAPI</var> = new Properties();
+<pre>Properties isoToGeoAPI = new Properties();
try (InputStream in = <code class="GeoAPI">UML</code>.class.getResourceAsStream("<code class="GeoAPI">class-index.properties</code>")) {
- <var>isoToGeoAPI</var>.load(in);
+ isoToGeoAPI.load(in);
}
-String <var>isoName</var> = "<code class="OGC">CI_Citation</code>";
-String <var>geoName</var> = getProperty(<var>isoName</var>);
-Class<?> <var>type</var> = Class.forName(<var>geoName</var>);
-System.out.println("Lâinterface GeoAPI pour le type <abbr>ISO</abbr> " + <var>isoName</var> + " est " + <var>type</var>);</pre>
+String isoName = "<code class="OGC">CI_Citation</code>";
+String geoName = getProperty(isoName);
+Class<?> type = Class.forName(geoName);
+System.out.println("Lâinterface GeoAPI pour le type <abbr>ISO</abbr> " + isoName + " est " + type);</pre>
<p>
La classe <code class="SIS">org.apache.sis.util.iso.Types</code> fournit la méthode de commodité
@@ -477,10 +476,10 @@ System.out.println("Lâinterface Geo
contrairement à celle de <code>Enum</code>, créeront de nouvelles instances si le nom donné ne correspond pas au nom dâune instance existante.
</p>
-<pre><code class="GeoAPI">MediumName</code> <var>cdRom</var> = <code class="GeoAPI">MediumName.CD_ROM;</code>
-<code class="GeoAPI">MediumName</code> <var>usbKey</var> = <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>"); <code class="comment">// Aucune constante nâexiste pour cette valeur.</code>
-assert <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">CD_ROM</code>") == <var>cdRom</var> : "valueOf doit retourner les constantes existantes.";
-assert <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>") == <var>usbKey</var> : "valueOf doit cacher les valeurs précédemment demandées.";</pre>
+<pre><code class="GeoAPI">MediumName</code> cdRom = <code class="GeoAPI">MediumName.CD_ROM;</code>
+<code class="GeoAPI">MediumName</code> usbKey = <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>"); // Aucune constante nâexiste pour cette valeur.
+assert <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">CD_ROM</code>") == cdRom : "valueOf doit retourner les constantes existantes.";
+assert <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>") == usbKey : "valueOf doit cacher les valeurs précédemment demandées.";</pre>
@@ -511,9 +510,9 @@ import java.util.ServiceLoader;
public class MyApplication {
public void createMyDatum() {
- ServiceLoader <var>loader</var> = ServiceLoader.load(<code class="GeoAPI">DatumFactory</code>.class);
- <code class="GeoAPI">DatumFactory</code> <var>factory</var> = <var>loader</var>.iterator().next();
- <code class="GeoAPI">GeodeticDatum</code> <var>myDatum</var> = <var>factory</var>.<code class="GeoAPI">createGeodeticDatum</code>(â¦);
+ ServiceLoader loader = ServiceLoader.load(<code class="GeoAPI">DatumFactory</code>.class);
+ <code class="GeoAPI">DatumFactory</code> factory = loader.iterator().next();
+ <code class="GeoAPI">GeodeticDatum</code> myDatum = factory.<code class="GeoAPI">createGeodeticDatum</code>(â¦);
}
}</pre>
@@ -719,13 +718,13 @@ public class MyApplication {
import <code class="GeoAPI">org.opengis.test.Validators</code>;
import org.junit.Test;
-public class MyTest {<code class="comment">
+public class MyTest {
/*
* Tolérer lâabsence dâattributs obligatoires dans les paquets metadata et citation.
* Cette modification sâappliquera à tous les tests exécutés dans la <abbr>JVM</abbr> courante.
* Sâil existe plusieurs classes de tests, cette initialisation peut être effectuée
* dans une classe parente à toutes les classes de tests.
- */</code>
+ */
static {
<code class="GeoAPI">Validators.DEFAULT.metadata.requireMandatoryAttributes</code> = false;
<code class="GeoAPI">Validators.DEFAULT.citation.requireMandatoryAttributes</code> = false;
@@ -733,8 +732,8 @@ public class MyTest {<code class="commen
@Test
public void testMyMetadata() {
- <code class="GeoAPI">Metadata</code> <var>myObject</var> = â¦; <code class="comment">// Construisez un objet ici.</code>
- <code class="GeoAPI">Validators.validate</code>(<var>myObject</var>);
+ <code class="GeoAPI">Metadata</code> myObject = â¦; // Construisez un objet ici.
+ <code class="GeoAPI">Validators.validate</code>(myObject);
}
}</pre>
@@ -749,18 +748,18 @@ import <code class="GeoAPI">org.opengis.
import org.junit.Test;
public class MyTest {
- private final <code class="GeoAPI">ValidatorContainer</code> <var>validators</var>;
+ private final <code class="GeoAPI">ValidatorContainer</code> validators;
public MyTest() {
- <var>validators</var> = new <code class="GeoAPI">ValidatorContainer()</code>;
- <var>validators</var>.<code class="GeoAPI">metadata.requireMandatoryAttributes</code> = false;
- <var>validators</var>.<code class="GeoAPI">citation.requireMandatoryAttributes</code> = false;
+ validators = new <code class="GeoAPI">ValidatorContainer()</code>;
+ validators.<code class="GeoAPI">metadata.requireMandatoryAttributes</code> = false;
+ validators.<code class="GeoAPI">citation.requireMandatoryAttributes</code> = false;
}
@Test
public void testMyMetadata() {
- <code class="GeoAPI">Metadata</code> <var>myObject</var> = â¦; <code class="comment">// Construisez un objet ici.</code>
- <var>validators</var>.<code class="GeoAPI">validate</code>(<var>myObject</var>);
+ <code class="GeoAPI">Metadata</code> myObject = â¦; // Construisez un objet ici.
+ validators.<code class="GeoAPI">validate</code>(myObject);
}
}</pre>
@@ -789,35 +788,35 @@ import <code class="GeoAPI">org.opengis.
import static org.junit.Assert.*;
@RunWith(JUnit4.class)
-public class MyTest extends <code class="GeoAPI">ParameterizedTransformTest</code> {<code class="comment">
+public class MyTest extends <code class="GeoAPI">ParameterizedTransformTest</code> {
/**
* Spécifie aux tests de GeoAPI notre propre fabrique de transformations de coordonnées.
* GeoAPI testera les objets construits par cette fabrique.
- */</code>
+ */
public MyTest() {
super(new MyMathTransformFactory());
}
-<code class="comment">
+
/**
* Modifie le comportement dâun test. Cet exemple assouplit un peu les exigences de ce test,
* en acceptant des erreurs jusquâà 10 centimètres plutôt que la valeur par défaut de 1 cm.
* Ce changement ne sâapplique quâà cette méthode est nâaffecte pas les autres tests hérités.
- */</code>
+ */
@Test
@Override
public void testLambertAzimuthalEqualArea() throws <code class="GeoAPI">FactoryException</code>, <code class="GeoAPI">TransformException</code> {
- <code class="GeoAPI"><var>tolerance</var></code> = 0.1; // Tolérance de 10 cm.
+ <code class="GeoAPI">tolerance</code> = 0.1; // Tolérance de 10 cm.
super.<code class="GeoAPI">testLambertAzimuthalEqualArea()</code>;
}
-<code class="comment">
+
/**
* Vérification supplémentaire effectuée après chaque test, hérité ou non.
* Dans cet exemple, nous vérifions que la transformation qui a été testée
* travaillait bien dans des espaces bi-dimensionnels.
- */</code>
+ */
@After
public void ensureAllTransformAreMath2D() {
- assertTrue(<code class="GeoAPI"><var>transform</var></code> instanceof <code class="GeoAPI">MathTransform2D</code>);
+ assertTrue(<code class="GeoAPI">transform</code> instanceof <code class="GeoAPI">MathTransform2D</code>);
}
}</pre>
Modified: sis/site/trunk/book/fr/utility.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/book/fr/utility.html?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/book/fr/utility.html (original)
+++ sis/site/trunk/book/fr/utility.html Fri Sep 25 21:10:23 2015
@@ -232,20 +232,20 @@
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt">for (int <var>i</var>=0; <var>i</var><<var>string</var>.length(); <var>i</var>++) {
- char <var>c</var> = <var>string</var>.charAt(<var>i</var>);
- if (Character.isWhitespace(<var>c</var>)) {
- <code class="comment">// Un espace blanc a été trouvé.</code>
+<pre style="margin-top: 6pt">for (int i=0; i<string.length(); i++) {
+ char c = string.charAt(i);
+ if (Character.isWhitespace(c)) {
+ // Un espace blanc a été trouvé.
}
}</pre>
</td>
<td>
-<pre style="margin-top: 6pt">for (int <var>i</var>=0; <var>i</var><<var>string</var>.length();) {
- int <var>c</var> = <var>string</var>.codePointAt(<var>i</var>);
- if (Character.isWhitespace(<var>c</var>)) {
- <code class="comment">// Un espace blanc a été trouvé.</code>
+<pre style="margin-top: 6pt">for (int i=0; i<string.length();) {
+ int c = string.codePointAt(i);
+ if (Character.isWhitespace(c)) {
+ // Un espace blanc a été trouvé.
}
- <var>i</var> += Character.charCount(<var>c</var>);
+ i += Character.charCount(c);
}</pre>
</td>
</tr>
Modified: sis/site/trunk/book/fr/xml.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/book/fr/xml.html?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/book/fr/xml.html (original)
+++ sis/site/trunk/book/fr/xml.html Fri Sep 25 21:10:23 2015
@@ -140,7 +140,8 @@
Cette pratique double la profondeur de lâarborescence, en introduisant une duplication
à tous les niveaux pour chaque valeur, comme dans lâexemple suivant:
</p>
-<pre><b><MD_Metadata></b>
+
+<pre class="xml"><b><MD_Metadata></b>
<identificationInfo>
<b><MD_DataIdentification></b>
<citation>
@@ -244,16 +245,16 @@
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><MD_MetaData>
+<pre class="xml" style="margin-top: 6pt"><MD_MetaData>
<identificationInfo>
<MD_DataIdentification id="<b>mon_id</b>">
- <code class="comment"><!-- insérer ici des propriétés filles --></code>
+ <!-- insérer ici des propriétés filles -->
</MD_DataIdentification>
</identificationInfo>
</MD_MetaData></pre>
</td>
<td>
-<pre style="margin-top: 6pt"><MD_MetaData>
+<pre class="xml" style="margin-top: 6pt"><MD_MetaData>
<identificationInfo idref="<b>mon_id</b>"/>
</MD_MetaData></pre>
</td>
@@ -294,9 +295,9 @@ import java.util.UUID;
public class MyClass {
public void myMethod() {
- UUID <var>identifier</var> = UUID.randomUUID();
- <code class="SIS">DefaultMetadata</code> <var>metadata</var> = new <code class="SIS">DefaultMetadata</code>();
- <var>metadata</var>.<code class="SIS">getIdentifierMap().putSpecialized</code>(<code class="SIS">IdentifierSpace.UUID</code>, <var>identifier</var>);
+ UUID identifier = UUID.randomUUID();
+ <code class="SIS">DefaultMetadata</code> metadata = new <code class="SIS">DefaultMetadata</code>();
+ metadata.<code class="SIS">getIdentifierMap().putSpecialized</code>(<code class="SIS">IdentifierSpace.UUID</code>, identifier);
}
}</pre>
@@ -348,16 +349,16 @@ public class MyClass {
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><CI_Citation>
+<pre class="xml" style="margin-top: 6pt"><CI_Citation>
<series>
<CI_Series>
- <code class="comment"><!-- insérer ici des propriétés filles --></code>
+ <!-- insérer ici des propriétés filles -->
</CI_Series>
</series>
</CI_Citation></pre>
</td>
<td>
-<pre style="margin-top: 6pt"><CI_Citation>
+<pre class="xml" style="margin-top: 6pt"><CI_Citation>
<series nilReason="unknown"/>
</CI_Citation></pre>
</td>
Modified: sis/site/trunk/content/book/book.css
URL: http://svn.apache.org/viewvc/sis/site/trunk/content/book/book.css?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/content/book/book.css (original)
+++ sis/site/trunk/content/book/book.css Fri Sep 25 21:10:23 2015
@@ -210,6 +210,9 @@ pre {
background: #F8F8F8
}
+pre.xml {
+}
+
/*
* OGC/ISO, GeoAPI and SIS legends.
*/
Modified: sis/site/trunk/content/book/en/developer-guide.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/content/book/en/developer-guide.html?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/content/book/en/developer-guide.html (original)
+++ sis/site/trunk/content/book/en/developer-guide.html Fri Sep 25 21:10:23 2015
@@ -708,19 +708,19 @@ and that this association is mandatory �
</p>
<pre><b>package</b> <code class="GeoAPI">org.opengis.referencing.crs</code>;
-<code class="comment">
-/**
+
+<code class="comment">/**
* A 2D coordinate reference system used to approximate the shape of the earth on a planar surface.
*/</code>
-<code class="GeoAPI">@UML</code>(<var>specification</var> = ISO_19111,
- <var>identifier</var> = "<code class="OGC">SC_ProjectedCRS</code>")
-<b>public</b> <b>interface</b> <code class="GeoAPI">ProjectedCRS</code> <b>extends</b> <code class="GeoAPI">GeneralDerivedCRS</code> {<code class="comment">
- /**
+<code class="GeoAPI">@UML</code>(specification = ISO_19111,
+ identifier = <i>"<code class="OGC">SC_ProjectedCRS</code>"</i>)
+<b>public</b> <b>interface</b> <code class="GeoAPI">ProjectedCRS</code> <b>extends</b> <code class="GeoAPI">GeneralDerivedCRS</code> {
+ <code class="comment">/**
* Returns the coordinate system, which must be Cartesian.
*/</code>
- <code class="GeoAPI">@UML</code>(<var>obligation</var> = MANDATORY,
- <var>specification</var> = ISO_19111,
- <var>identifier</var> = "<code class="OGC">coordinateSystem</code>")
+ <code class="GeoAPI">@UML</code>(obligation = MANDATORY,
+ specification = ISO_19111,
+ identifier = <i>"<code class="OGC">coordinateSystem</code>"</i>)
<code class="GeoAPI">CartesianCS getCoordinateSystem()</code>;
}</pre>
@@ -731,11 +731,11 @@ or for writing elements in an <abbr>XML<
The following example displays the standard name for the method <code class="GeoAPI">getTitle()</code> from the <code class="GeoAPI">Citation</code> interface:
</p>
-<pre>Class<?> <var>type</var> = <code class="GeoAPI">Citation</code>.<b>class</b>;
-Method <var>method</var> = <var>type</var>.getMethod("<code class="GeoAPI">getTitle</code>", (Class<?>[]) <b>null</b>);
-<code class="GeoAPI">UML</code> <var>annot</var> = <var>method</var>.getAnnotation(<code class="GeoAPI">UML</code>.<b>class</b>);
-String <var>id</var> = <var>annot</var>.identifier();
-System.out.println("The standard name for the " + <var>method</var>.getName() + " method is " + <var>id</var>);</pre>
+<pre>Class<?> type = <code class="GeoAPI">Citation</code>.<b>class</b>;
+Method method = type.getMethod(<i>"<code class="GeoAPI">getTitle</code>"</i>, (Class<?>[]) <b>null</b>);
+<code class="GeoAPI">UML</code> annot = method.getAnnotation(<code class="GeoAPI">UML</code>.<b>class</b>);
+String id = annot.identifier();
+System.out.println(<i>"The standard name for the "</i> + method.getName() + <i>" method is "</i> + id);</pre>
<p>
The class <code class="SIS">org.apache.sis.util.iso.Types</code> provides the
@@ -749,14 +749,14 @@ The following example reads the files ju
Users are always encouraged to only read this file once and then save its contents in their application's cache.
</p>
-<pre>Properties <var>isoToGeoAPI</var> = <b>new</b> Properties();
-<b>try</b> (InputStream in = <code class="GeoAPI">UML</code>.<b>class</b>.getResourceAsStream("<code class="GeoAPI">class-index.properties</code>")) {
- <var>isoToGeoAPI</var>.load(in);
+<pre>Properties isoToGeoAPI = <b>new</b> Properties();
+<b>try</b> (InputStream in = <code class="GeoAPI">UML</code>.<b>class</b>.getResourceAsStream(<i>"<code class="GeoAPI">class-index.properties</code>"</i>)) {
+ isoToGeoAPI.load(in);
}
-String <var>isoName</var> = "<code class="OGC">CI_Citation</code>";
-String <var>geoName</var> = getProperty(<var>isoName</var>);
-Class<?> <var>type</var> = Class.forName(<var>geoName</var>);
-System.out.println("The GeoAPI interface for <abbr>ISO</abbr> type " + <var>isoName</var> + " is " + <var>type</var>);</pre>
+String isoName = <i>"<code class="OGC">CI_Citation</code>"</i>;
+String geoName = getProperty(isoName);
+Class<?> type = Class.forName(geoName);
+System.out.println(<i>"The GeoAPI interface for <abbr>ISO</abbr> type "</i> + isoName + <i>" is "</i> + type);</pre>
<p>
The class <code class="SIS">org.apache.sis.util.iso.Types</code> provides the
@@ -943,10 +943,10 @@ Extensions are made available by the <co
creates new instances if the name provided does not correspond to the name of an existing instance.
</p>
-<pre><code class="GeoAPI">MediumName</code> <var>cdRom</var> = <code class="GeoAPI">MediumName.CD_ROM;</code>
-<code class="GeoAPI">MediumName</code> <var>usbKey</var> = <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>"); <code class="comment">// There is no constraint on <b>this</b> value.</code>
-<b>assert</b> <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">CD_ROM</code>") == <var>cdRom</var> : "valueOf must return existing constants.";
-<b>assert</b> <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>") == <var>usbKey</var> : "valueOf must cache the previously requested values.";</pre>
+<pre><code class="GeoAPI">MediumName</code> cdRom = <code class="GeoAPI">MediumName.CD_ROM;</code>
+<code class="GeoAPI">MediumName</code> usbKey = <code class="GeoAPI">MediumName.valueOf</code>(<i>"<code class="GeoAPI">USB_KEY</code>"</i>); <code class="comment">// There is no constraint on this value.
+</code><b>assert</b> <code class="GeoAPI">MediumName.valueOf</code>(<i>"<code class="GeoAPI">CD_ROM</code>"</i>) == cdRom : <i>"valueOf must return existing constants."</i>;
+<b>assert</b> <code class="GeoAPI">MediumName.valueOf</code>(<i>"<code class="GeoAPI">USB_KEY</code>"</i>) == usbKey : <i>"valueOf must cache the previously requested values."</i>;</pre>
@@ -977,9 +977,9 @@ for example when multiple libraries coex
<b>public</b> <b>class</b> MyApplication {
<b>public</b> <b>void</b> createMyDatum() {
- ServiceLoader <var>loader</var> = ServiceLoader.load(<code class="GeoAPI">DatumFactory</code>.<b>class</b>);
- <code class="GeoAPI">DatumFactory</code> <var>factory</var> = <var>loader</var>.iterator().next();
- <code class="GeoAPI">GeodeticDatum</code> <var>myDatum</var> = <var>factory</var>.<code class="GeoAPI">createGeodeticDatum</code>(â¦);
+ ServiceLoader loader = ServiceLoader.load(<code class="GeoAPI">DatumFactory</code>.<b>class</b>);
+ <code class="GeoAPI">DatumFactory</code> factory = loader.iterator().next();
+ <code class="GeoAPI">GeodeticDatum</code> myDatum = factory.<code class="GeoAPI">createGeodeticDatum</code>(â¦);
}
}</pre>
@@ -1172,12 +1172,12 @@ as in the following example:
<b>import</b> <code class="GeoAPI">org.opengis.test.Validators</code>;
<b>import</b> org.junit.Test;
-<b>public</b> <b>class</b> MyTest {<code class="comment">
- /*
+<b>public</b> <b>class</b> MyTest {
+ <code class="comment">/*
* Tolerate the absence of mandatory attributes in metadata and citation packages.
* This modification applies to all tests executed by the currently running <abbr>JVM</abbr>.
- * If there are multiple test classes, <b>this</b> initialization may be performed
- * in a parent <b>class</b> to all test classes.
+ * If there are multiple test classes, this initialization may be performed
+ * in a parent class to all test classes.
*/</code>
<b>static</b> {
<code class="GeoAPI">Validators.DEFAULT.metadata.requireMandatoryAttributes</code> = <b>false</b>;
@@ -1186,8 +1186,8 @@ as in the following example:
@Test
<b>public</b> <b>void</b> testMyMetadata() {
- <code class="GeoAPI">Metadata</code> <var>myObject</var> = â¦; <code class="comment">// Create an object here.</code>
- <code class="GeoAPI">Validators.validate</code>(<var>myObject</var>);
+ <code class="GeoAPI">Metadata</code> myObject = â¦; <code class="comment">// Create an object here.
+</code> <code class="GeoAPI">Validators.validate</code>(myObject);
}
}</pre>
@@ -1201,18 +1201,18 @@ This approach requires the creation of a
<b>import</b> org.junit.Test;
<b>public</b> <b>class</b> MyTest {
- <b>private</b> <b>final</b> <code class="GeoAPI">ValidatorContainer</code> <var>validators</var>;
+ <b>private</b> <b>final</b> <code class="GeoAPI">ValidatorContainer</code> validators;
<b>public</b> MyTest() {
- <var>validators</var> = <b>new</b> <code class="GeoAPI">ValidatorContainer()</code>;
- <var>validators</var>.<code class="GeoAPI">metadata.requireMandatoryAttributes</code> = <b>false</b>;
- <var>validators</var>.<code class="GeoAPI">citation.requireMandatoryAttributes</code> = <b>false</b>;
+ validators = <b>new</b> <code class="GeoAPI">ValidatorContainer()</code>;
+ validators.<code class="GeoAPI">metadata.requireMandatoryAttributes</code> = <b>false</b>;
+ validators.<code class="GeoAPI">citation.requireMandatoryAttributes</code> = <b>false</b>;
}
@Test
<b>public</b> <b>void</b> testMyMetadata() {
- <code class="GeoAPI">Metadata</code> <var>myObject</var> = â¦; <code class="comment">// Create an object here.</code>
- <var>validators</var>.<code class="GeoAPI">validate</code>(<var>myObject</var>);
+ <code class="GeoAPI">Metadata</code> myObject = â¦; <code class="comment">// Create an object here.
+</code> validators.<code class="GeoAPI">validate</code>(myObject);
}
}</pre>
@@ -1240,35 +1240,35 @@ However, this example adds a supplementa
<b>import</b> <b>static</b> org.junit.Assert.*;
@RunWith(JUnit4.<b>class</b>)
-<b>public</b> <b>class</b> MyTest <b>extends</b> <code class="GeoAPI">ParameterizedTransformTest</code> {<code class="comment">
- /**
- * Specify our own coordinate transformation factory <b>for</b> the GeoAPI tests.
- * GeoAPI will test the objects created by <b>this</b> factory.
+<b>public</b> <b>class</b> MyTest <b>extends</b> <code class="GeoAPI">ParameterizedTransformTest</code> {
+ <code class="comment">/**
+ * Specify our own coordinate transformation factory for the GeoAPI tests.
+ * GeoAPI will test the objects created by this factory.
*/</code>
<b>public</b> MyTest() {
<b>super</b>(<b>new</b> MyMathTransformFactory());
}
-<code class="comment">
- /**
- * Changes the behaviour of a test. This example relaxes the requirements of <b>this</b> test a little,
- * by accepting errors of up to 10 centimetres, rather than the <b>default</b> value of 1 cm.
- * This change only applies to <b>this</b> method, and does not affect the other inherited tests.
+
+ <code class="comment">/**
+ * Changes the behaviour of a test. This example relaxes the requirements of this test a little,
+ * by accepting errors of up to 10 centimetres, rather than the default value of 1 cm.
+ * This change only applies to this method, and does not affect the other inherited tests.
*/</code>
@Test
@Override
<b>public</b> <b>void</b> testLambertAzimuthalEqualArea() <b>throws</b> <code class="GeoAPI">FactoryException</code>, <code class="GeoAPI">TransformException</code> {
- <code class="GeoAPI"><var>tolerance</var></code> = 0.1; // 10 cm tolerance.
- <b>super</b>.<code class="GeoAPI">testLambertAzimuthalEqualArea()</code>;
+ <code class="GeoAPI">tolerance</code> = 0.1; <code class="comment">// 10 cm tolerance.
+</code> <b>super</b>.<code class="GeoAPI">testLambertAzimuthalEqualArea()</code>;
}
-<code class="comment">
- /**
+
+ <code class="comment">/**
* Supplemental verification performed after each test, inherited or not.
- * In <b>this</b> example, we are verifying that the transformation tested
+ * In this example, we are verifying that the transformation tested
* works correctly in two-dimensional spaces.
*/</code>
@After
<b>public</b> <b>void</b> ensureAllTransformAreMath2D() {
- assertTrue(<code class="GeoAPI"><var>transform</var></code> <b>instanceof</b> <code class="GeoAPI">MathTransform2D</code>);
+ assertTrue(<code class="GeoAPI">transform</code> <b>instanceof</b> <code class="GeoAPI">MathTransform2D</code>);
}
}</pre>
@@ -1416,7 +1416,8 @@ the value of the <code class="OGC">cited
This practice doubles the depth of the hierarchy, and introduces duplication at all levels for each value,
as in the following example:
</p>
-<pre><b><MD_Metadata></b>
+
+<pre class="xml"><b><MD_Metadata></b>
<identificationInfo>
<b><MD_DataIdentification></b>
<citation>
@@ -1516,17 +1517,17 @@ while the part on the right references t
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><MD_MetaData>
+<pre class="xml" style="margin-top: 6pt"><MD_MetaData>
<identificationInfo>
- <MD_DataIdentification id="<b>my_id</b>">
+ <MD_DataIdentification id=<i>"<b>my_id</b>"</i>>
<code class="comment"><!-- insert child properties here --></code>
</MD_DataIdentification>
</identificationInfo>
</MD_MetaData></pre>
</td>
<td>
-<pre style="margin-top: 6pt"><MD_MetaData>
- <identificationInfo idref="<b>my_id</b>"/>
+<pre class="xml" style="margin-top: 6pt"><MD_MetaData>
+ <identificationInfo idref=<i>"<b>my_id</b>"</i>/>
</MD_MetaData></pre>
</td>
</tr>
@@ -1565,9 +1566,9 @@ For example, the following code defines
<b>public</b> <b>class</b> MyClass {
<b>public</b> <b>void</b> myMethod() {
- UUID <var>identifier</var> = UUID.randomUUID();
- <code class="SIS">DefaultMetadata</code> <var>metadata</var> = <b>new</b> <code class="SIS">DefaultMetadata</code>();
- <var>metadata</var>.<code class="SIS">getIdentifierMap().putSpecialized</code>(<code class="SIS">IdentifierSpace.UUID</code>, <var>identifier</var>);
+ UUID identifier = UUID.randomUUID();
+ <code class="SIS">DefaultMetadata</code> metadata = <b>new</b> <code class="SIS">DefaultMetadata</code>();
+ metadata.<code class="SIS">getIdentifierMap().putSpecialized</code>(<code class="SIS">IdentifierSpace.UUID</code>, identifier);
}
}</pre>
@@ -1618,7 +1619,7 @@ But when a <code class="OGC">nilReason</
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><CI_Citation>
+<pre class="xml" style="margin-top: 6pt"><CI_Citation>
<series>
<CI_Series>
<code class="comment"><!-- insert child properties here --></code>
@@ -1627,8 +1628,8 @@ But when a <code class="OGC">nilReason</
</CI_Citation></pre>
</td>
<td>
-<pre style="margin-top: 6pt"><CI_Citation>
- <series nilReason="unknown"/>
+<pre class="xml" style="margin-top: 6pt"><CI_Citation>
+ <series nilReason=<i>"unknown"</i>/>
</CI_Citation></pre>
</td>
</tr>
@@ -1850,20 +1851,20 @@ Thus, instead of the loop on the left be
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><b>for</b> (<b>int</b> <var>i</var>=0; <var>i</var><<var>string</var>.length(); <var>i</var>++) {
- <b>char</b> <var>c</var> = <var>string</var>.charAt(<var>i</var>);
- <b>if</b> (Character.isWhitespace(<var>c</var>)) {
- <code class="comment">// A blank space was found.</code>
- }
+<pre style="margin-top: 6pt"><b>for</b> (<b>int</b> i=0; i<string.length(); i++) {
+ <b>char</b> c = string.charAt(i);
+ <b>if</b> (Character.isWhitespace(c)) {
+ <code class="comment">// A blank space was found.
+</code> }
}</pre>
</td>
<td>
-<pre style="margin-top: 6pt"><b>for</b> (<b>int</b> <var>i</var>=0; <var>i</var><<var>string</var>.length();) {
- <b>int</b> <var>c</var> = <var>string</var>.codePointAt(<var>i</var>);
- <b>if</b> (Character.isWhitespace(<var>c</var>)) {
- <code class="comment">// A blank space was found.</code>
- }
- <var>i</var> += Character.charCount(<var>c</var>);
+<pre style="margin-top: 6pt"><b>for</b> (<b>int</b> i=0; i<string.length();) {
+ <b>int</b> c = string.codePointAt(i);
+ <b>if</b> (Character.isWhitespace(c)) {
+ <code class="comment">// A blank space was found.
+</code> }
+ i += Character.charCount(c);
}</pre>
</td>
</tr>
Modified: sis/site/trunk/content/book/fr/developer-guide.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/content/book/fr/developer-guide.html?rev=1705356&r1=1705355&r2=1705356&view=diff
==============================================================================
--- sis/site/trunk/content/book/fr/developer-guide.html [UTF-8] (original)
+++ sis/site/trunk/content/book/fr/developer-guide.html [UTF-8] Fri Sep 25 21:10:23 2015
@@ -747,19 +747,18 @@ pas autorisée à retourner la valeur <c
</p>
<pre><b>package</b> <code class="GeoAPI">org.opengis.referencing.crs</code>;
-<code class="comment">
-/**
+<code class="comment">/**
* A 2D coordinate reference system used to approximate the shape of the earth on a planar surface.
*/</code>
-<code class="GeoAPI">@UML</code>(<var>specification</var> = ISO_19111,
- <var>identifier</var> = "<code class="OGC">SC_ProjectedCRS</code>")
-<b>public</b> <b>interface</b> <code class="GeoAPI">ProjectedCRS</code> <b>extends</b> <code class="GeoAPI">GeneralDerivedCRS</code> {<code class="comment">
- /**
+<code class="GeoAPI">@UML</code>(specification = ISO_19111,
+ identifier = <i>"<code class="OGC">SC_ProjectedCRS</code>"</i>)
+<b>public</b> <b>interface</b> <code class="GeoAPI">ProjectedCRS</code> <b>extends</b> <code class="GeoAPI">GeneralDerivedCRS</code> {
+ <code class="comment">/**
* Returns the coordinate system, which must be Cartesian.
*/</code>
- <code class="GeoAPI">@UML</code>(<var>obligation</var> = MANDATORY,
- <var>specification</var> = ISO_19111,
- <var>identifier</var> = "<code class="OGC">coordinateSystem</code>")
+ <code class="GeoAPI">@UML</code>(obligation = MANDATORY,
+ specification = ISO_19111,
+ identifier = <i>"<code class="OGC">coordinateSystem</code>"</i>)
<code class="GeoAPI">CartesianCS getCoordinateSystem()</code>;
}</pre>
@@ -770,11 +769,11 @@ ou pour écrire des éléments dans un d
méthode <code class="GeoAPI">getTitle()</code> de l’interface <code class="GeoAPI">Citation</code>:
</p>
-<pre>Class<?> <var>type</var> = <code class="GeoAPI">Citation</code>.<b>class</b>;
-Method <var>method</var> = <var>type</var>.getMethod("<code class="GeoAPI">getTitle</code>", (Class<?>[]) <b>null</b>);
-<code class="GeoAPI">UML</code> <var>annot</var> = <var>method</var>.getAnnotation(<code class="GeoAPI">UML</code>.<b>class</b>);
-String <var>id</var> = <var>annot</var>.identifier();
-System.out.println("Le nom standard de la méthode " + <var>method</var>.getName() + " est " + <var>id</var>);</pre>
+<pre>Class<?> type = <code class="GeoAPI">Citation</code>.<b>class</b>;
+Method method = type.getMethod(<i>"<code class="GeoAPI">getTitle</code>"</i>, (Class<?>[]) <b>null</b>);
+<code class="GeoAPI">UML</code> annot = method.getAnnotation(<code class="GeoAPI">UML</code>.<b>class</b>);
+String id = annot.identifier();
+System.out.println(<i>"Le nom standard de la méthode "</i> + method.getName() + <i>" est "</i> + id);</pre>
<p>
La classe <code class="SIS">org.apache.sis.util.iso.Types</code> fournit la méthode de commodité
@@ -790,14 +789,14 @@ Toutefois les utilisateurs sont encourag
une cache de leur application.
</p>
-<pre>Properties <var>isoToGeoAPI</var> = <b>new</b> Properties();
-<b>try</b> (InputStream in = <code class="GeoAPI">UML</code>.<b>class</b>.getResourceAsStream("<code class="GeoAPI">class-index.properties</code>")) {
- <var>isoToGeoAPI</var>.load(in);
+<pre>Properties isoToGeoAPI = <b>new</b> Properties();
+<b>try</b> (InputStream in = <code class="GeoAPI">UML</code>.<b>class</b>.getResourceAsStream(<i>"<code class="GeoAPI">class-index.properties</code>"</i>)) {
+ isoToGeoAPI.load(in);
}
-String <var>isoName</var> = "<code class="OGC">CI_Citation</code>";
-String <var>geoName</var> = getProperty(<var>isoName</var>);
-Class<?> <var>type</var> = Class.forName(<var>geoName</var>);
-System.out.println("L’interface GeoAPI pour le type <abbr>ISO</abbr> " + <var>isoName</var> + " est " + <var>type</var>);</pre>
+String isoName = <i>"<code class="OGC">CI_Citation</code>"</i>;
+String geoName = getProperty(isoName);
+Class<?> type = Class.forName(geoName);
+System.out.println(<i>"L’interface GeoAPI pour le type <abbr>ISO</abbr> "</i> + isoName + <i>" est "</i> + type);</pre>
<p>
La classe <code class="SIS">org.apache.sis.util.iso.Types</code> fournit la méthode de commodité
@@ -986,10 +985,10 @@ Les extensions s’obtiennent par les m�
contrairement à celle de <code>Enum</code>, créeront de nouvelles instances si le nom donné ne correspond pas au nom d’une instance existante.
</p>
-<pre><code class="GeoAPI">MediumName</code> <var>cdRom</var> = <code class="GeoAPI">MediumName.CD_ROM;</code>
-<code class="GeoAPI">MediumName</code> <var>usbKey</var> = <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>"); <code class="comment">// Aucune constante n’existe pour cette valeur.</code>
-<b>assert</b> <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">CD_ROM</code>") == <var>cdRom</var> : "valueOf doit retourner les constantes existantes.";
-<b>assert</b> <code class="GeoAPI">MediumName.valueOf</code>("<code class="GeoAPI">USB_KEY</code>") == <var>usbKey</var> : "valueOf doit cacher les valeurs précédemment demandées.";</pre>
+<pre><code class="GeoAPI">MediumName</code> cdRom = <code class="GeoAPI">MediumName.CD_ROM;</code>
+<code class="GeoAPI">MediumName</code> usbKey = <code class="GeoAPI">MediumName.valueOf</code>(<i>"<code class="GeoAPI">USB_KEY</code>"</i>); <code class="comment">// Aucune constante n’existe pour cette valeur.
+</code><b>assert</b> <code class="GeoAPI">MediumName.valueOf</code>(<i>"<code class="GeoAPI">CD_ROM</code>"</i>) == cdRom : <i>"valueOf doit retourner les constantes existantes."</i>;
+<b>assert</b> <code class="GeoAPI">MediumName.valueOf</code>(<i>"<code class="GeoAPI">USB_KEY</code>"</i>) == usbKey : <i>"valueOf doit cacher les valeurs précédemment demandées."</i>;</pre>
@@ -1020,9 +1019,9 @@ par exemple lorsque plusieurs bibliothè
<b>public</b> <b>class</b> MyApplication {
<b>public</b> <b>void</b> createMyDatum() {
- ServiceLoader <var>loader</var> = ServiceLoader.load(<code class="GeoAPI">DatumFactory</code>.<b>class</b>);
- <code class="GeoAPI">DatumFactory</code> <var>factory</var> = <var>loader</var>.iterator().next();
- <code class="GeoAPI">GeodeticDatum</code> <var>myDatum</var> = <var>factory</var>.<code class="GeoAPI">createGeodeticDatum</code>(…);
+ ServiceLoader loader = ServiceLoader.load(<code class="GeoAPI">DatumFactory</code>.<b>class</b>);
+ <code class="GeoAPI">DatumFactory</code> factory = loader.iterator().next();
+ <code class="GeoAPI">GeodeticDatum</code> myDatum = factory.<code class="GeoAPI">createGeodeticDatum</code>(…);
}
}</pre>
@@ -1228,8 +1227,8 @@ Cette règle et quelques autres peuvent
<b>import</b> <code class="GeoAPI">org.opengis.test.Validators</code>;
<b>import</b> org.junit.Test;
-<b>public</b> <b>class</b> MyTest {<code class="comment">
- /*
+<b>public</b> <b>class</b> MyTest {
+ <code class="comment">/*
* Tolérer l’absence d’attributs obligatoires dans les paquets metadata et citation.
* Cette modification s’appliquera à tous les tests exécutés dans la <abbr>JVM</abbr> courante.
* S’il existe plusieurs classes de tests, cette initialisation peut être effectuée
@@ -1242,8 +1241,8 @@ Cette règle et quelques autres peuvent
@Test
<b>public</b> <b>void</b> testMyMetadata() {
- <code class="GeoAPI">Metadata</code> <var>myObject</var> = …; <code class="comment">// Construisez un objet ici.</code>
- <code class="GeoAPI">Validators.validate</code>(<var>myObject</var>);
+ <code class="GeoAPI">Metadata</code> myObject = …; <code class="comment">// Construisez un objet ici.
+</code> <code class="GeoAPI">Validators.validate</code>(myObject);
}
}</pre>
@@ -1258,18 +1257,18 @@ Cette approche nécessite de créer une
<b>import</b> org.junit.Test;
<b>public</b> <b>class</b> MyTest {
- <b>private</b> <b>final</b> <code class="GeoAPI">ValidatorContainer</code> <var>validators</var>;
+ <b>private</b> <b>final</b> <code class="GeoAPI">ValidatorContainer</code> validators;
<b>public</b> MyTest() {
- <var>validators</var> = <b>new</b> <code class="GeoAPI">ValidatorContainer()</code>;
- <var>validators</var>.<code class="GeoAPI">metadata.requireMandatoryAttributes</code> = <b>false</b>;
- <var>validators</var>.<code class="GeoAPI">citation.requireMandatoryAttributes</code> = <b>false</b>;
+ validators = <b>new</b> <code class="GeoAPI">ValidatorContainer()</code>;
+ validators.<code class="GeoAPI">metadata.requireMandatoryAttributes</code> = <b>false</b>;
+ validators.<code class="GeoAPI">citation.requireMandatoryAttributes</code> = <b>false</b>;
}
@Test
<b>public</b> <b>void</b> testMyMetadata() {
- <code class="GeoAPI">Metadata</code> <var>myObject</var> = …; <code class="comment">// Construisez un objet ici.</code>
- <var>validators</var>.<code class="GeoAPI">validate</code>(<var>myObject</var>);
+ <code class="GeoAPI">Metadata</code> myObject = …; <code class="comment">// Construisez un objet ici.
+</code> validators.<code class="GeoAPI">validate</code>(myObject);
}
}</pre>
@@ -1298,16 +1297,16 @@ qui sera exécutée après chacun des te
<b>import</b> <b>static</b> org.junit.Assert.*;
@RunWith(JUnit4.<b>class</b>)
-<b>public</b> <b>class</b> MyTest <b>extends</b> <code class="GeoAPI">ParameterizedTransformTest</code> {<code class="comment">
- /**
+<b>public</b> <b>class</b> MyTest <b>extends</b> <code class="GeoAPI">ParameterizedTransformTest</code> {
+ <code class="comment">/**
* Spécifie aux tests de GeoAPI notre propre fabrique de transformations de coordonnées.
* GeoAPI testera les objets construits par cette fabrique.
*/</code>
<b>public</b> MyTest() {
<b>super</b>(<b>new</b> MyMathTransformFactory());
}
-<code class="comment">
- /**
+
+ <code class="comment">/**
* Modifie le comportement d’un test. Cet exemple assouplit un peu les exigences de ce test,
* en acceptant des erreurs jusqu’à 10 centimètres plutôt que la valeur par défaut de 1 cm.
* Ce changement ne s’applique qu’à cette méthode est n’affecte pas les autres tests hérités.
@@ -1315,18 +1314,18 @@ qui sera exécutée après chacun des te
@Test
@Override
<b>public</b> <b>void</b> testLambertAzimuthalEqualArea() <b>throws</b> <code class="GeoAPI">FactoryException</code>, <code class="GeoAPI">TransformException</code> {
- <code class="GeoAPI"><var>tolerance</var></code> = 0.1; // Tolérance de 10 cm.
- <b>super</b>.<code class="GeoAPI">testLambertAzimuthalEqualArea()</code>;
+ <code class="GeoAPI">tolerance</code> = 0.1; <code class="comment">// Tolérance de 10 cm.
+</code> <b>super</b>.<code class="GeoAPI">testLambertAzimuthalEqualArea()</code>;
}
-<code class="comment">
- /**
+
+ <code class="comment">/**
* Vérification supplémentaire effectuée après chaque test, hérité ou non.
* Dans cet exemple, nous vérifions que la transformation qui a été testée
* travaillait bien dans des espaces bi-dimensionnels.
*/</code>
@After
<b>public</b> <b>void</b> ensureAllTransformAreMath2D() {
- assertTrue(<code class="GeoAPI"><var>transform</var></code> <b>instanceof</b> <code class="GeoAPI">MathTransform2D</code>);
+ assertTrue(<code class="GeoAPI">transform</code> <b>instanceof</b> <code class="GeoAPI">MathTransform2D</code>);
}
}</pre>
@@ -1478,7 +1477,8 @@ est enveloppée dans un élément <code
Cette pratique double la profondeur de l’arborescence, en introduisant une duplication
à tous les niveaux pour chaque valeur, comme dans l’exemple suivant:
</p>
-<pre><b><MD_Metadata></b>
+
+<pre class="xml"><b><MD_Metadata></b>
<identificationInfo>
<b><MD_DataIdentification></b>
<citation>
@@ -1582,17 +1582,17 @@ alors que la partie droite référence c
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><MD_MetaData>
+<pre class="xml" style="margin-top: 6pt"><MD_MetaData>
<identificationInfo>
- <MD_DataIdentification id="<b>mon_id</b>">
+ <MD_DataIdentification id=<i>"<b>mon_id</b>"</i>>
<code class="comment"><!-- insérer ici des propriétés filles --></code>
</MD_DataIdentification>
</identificationInfo>
</MD_MetaData></pre>
</td>
<td>
-<pre style="margin-top: 6pt"><MD_MetaData>
- <identificationInfo idref="<b>mon_id</b>"/>
+<pre class="xml" style="margin-top: 6pt"><MD_MetaData>
+ <identificationInfo idref=<i>"<b>mon_id</b>"</i>/>
</MD_MetaData></pre>
</td>
</tr>
@@ -1632,9 +1632,9 @@ Par exemple le code suivant définit une
<b>public</b> <b>class</b> MyClass {
<b>public</b> <b>void</b> myMethod() {
- UUID <var>identifier</var> = UUID.randomUUID();
- <code class="SIS">DefaultMetadata</code> <var>metadata</var> = <b>new</b> <code class="SIS">DefaultMetadata</code>();
- <var>metadata</var>.<code class="SIS">getIdentifierMap().putSpecialized</code>(<code class="SIS">IdentifierSpace.UUID</code>, <var>identifier</var>);
+ UUID identifier = UUID.randomUUID();
+ <code class="SIS">DefaultMetadata</code> metadata = <b>new</b> <code class="SIS">DefaultMetadata</code>();
+ metadata.<code class="SIS">getIdentifierMap().putSpecialized</code>(<code class="SIS">IdentifierSpace.UUID</code>, identifier);
}
}</pre>
@@ -1686,7 +1686,7 @@ et dont la méthode <code class="SIS">ge
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><CI_Citation>
+<pre class="xml" style="margin-top: 6pt"><CI_Citation>
<series>
<CI_Series>
<code class="comment"><!-- insérer ici des propriétés filles --></code>
@@ -1695,8 +1695,8 @@ et dont la méthode <code class="SIS">ge
</CI_Citation></pre>
</td>
<td>
-<pre style="margin-top: 6pt"><CI_Citation>
- <series nilReason="unknown"/>
+<pre class="xml" style="margin-top: 6pt"><CI_Citation>
+ <series nilReason=<i>"unknown"</i>/>
</CI_Citation></pre>
</td>
</tr>
@@ -1918,20 +1918,20 @@ généralement utiliser la boucle de dro
</tr>
<tr>
<td>
-<pre style="margin-top: 6pt"><b>for</b> (<b>int</b> <var>i</var>=0; <var>i</var><<var>string</var>.length(); <var>i</var>++) {
- <b>char</b> <var>c</var> = <var>string</var>.charAt(<var>i</var>);
- <b>if</b> (Character.isWhitespace(<var>c</var>)) {
- <code class="comment">// Un espace blanc a été trouvé.</code>
- }
+<pre style="margin-top: 6pt"><b>for</b> (<b>int</b> i=0; i<string.length(); i++) {
+ <b>char</b> c = string.charAt(i);
+ <b>if</b> (Character.isWhitespace(c)) {
+ <code class="comment">// Un espace blanc a été trouvé.
+</code> }
}</pre>
</td>
<td>
-<pre style="margin-top: 6pt"><b>for</b> (<b>int</b> <var>i</var>=0; <var>i</var><<var>string</var>.length();) {
- <b>int</b> <var>c</var> = <var>string</var>.codePointAt(<var>i</var>);
- <b>if</b> (Character.isWhitespace(<var>c</var>)) {
- <code class="comment">// Un espace blanc a été trouvé.</code>
- }
- <var>i</var> += Character.charCount(<var>c</var>);
+<pre style="margin-top: 6pt"><b>for</b> (<b>int</b> i=0; i<string.length();) {
+ <b>int</b> c = string.codePointAt(i);
+ <b>if</b> (Character.isWhitespace(c)) {
+ <code class="comment">// Un espace blanc a été trouvé.
+</code> }
+ i += Character.charCount(c);
}</pre>
</td>
</tr>