1.1 --- a/json/pom.xml Tue Apr 23 16:16:45 2013 +0200
1.2 +++ b/json/pom.xml Tue Apr 23 20:43:19 2013 +0200
1.3 @@ -15,6 +15,18 @@
1.4 <properties>
1.5 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1.6 </properties>
1.7 + <build>
1.8 + <plugins>
1.9 + <plugin>
1.10 + <groupId>org.apache.maven.plugins</groupId>
1.11 + <artifactId>maven-javadoc-plugin</artifactId>
1.12 + <configuration>
1.13 + <subpackages>net.java.html.json</subpackages>
1.14 + <skip>false</skip>
1.15 + </configuration>
1.16 + </plugin>
1.17 + </plugins>
1.18 + </build>
1.19 <dependencies>
1.20 <dependency>
1.21 <groupId>org.testng</groupId>
2.1 --- a/json/src/main/java/net/java/html/json/ComputedProperty.java Tue Apr 23 16:16:45 2013 +0200
2.2 +++ b/json/src/main/java/net/java/html/json/ComputedProperty.java Tue Apr 23 20:43:19 2013 +0200
2.3 @@ -25,12 +25,12 @@
2.4 import java.lang.annotation.RetentionPolicy;
2.5 import java.lang.annotation.Target;
2.6
2.7 -/** Can be used in classes annotated with {@link Page} annotation to
2.8 +/** Can be used in classes annotated with {@link Model} annotation to
2.9 * define a derived property. Value of derived property is based on values
2.10 - * of {@link Property} as enumerated by {@link Page#properties()}.
2.11 + * of {@link Property} as enumerated by {@link Model#properties()}.
2.12 * <p>
2.13 * The name of the derived property is the name of the method. The arguments
2.14 - * of the method define the property names (from {@link Page#properties()} list)
2.15 + * of the method define the property names (from {@link Model#properties()} list)
2.16 * the value of property depends on.
2.17 *
2.18 * @author Jaroslav Tulach <jtulach@netbeans.org>
3.1 --- a/json/src/main/java/net/java/html/json/Function.java Tue Apr 23 16:16:45 2013 +0200
3.2 +++ b/json/src/main/java/net/java/html/json/Function.java Tue Apr 23 20:43:19 2013 +0200
3.3 @@ -25,7 +25,7 @@
3.4 import java.lang.annotation.RetentionPolicy;
3.5 import java.lang.annotation.Target;
3.6
3.7 -/** Methods in class annotated by {@link Model} or {@link Page} can be
3.8 +/** Methods in class annotated by {@link Model} can be
3.9 * annotated by this annotation to signal that they should be available
3.10 * as functions to users of the model classes.
3.11 *
4.1 --- a/json/src/main/java/net/java/html/json/Model.java Tue Apr 23 16:16:45 2013 +0200
4.2 +++ b/json/src/main/java/net/java/html/json/Model.java Tue Apr 23 20:43:19 2013 +0200
4.3 @@ -26,13 +26,29 @@
4.4 import java.lang.annotation.Target;
4.5
4.6 /** Defines a model class named {@link #className()} which contains
4.7 - * defined {@link #properties()}. This class can have methods
4.8 + * properties defined via {@link #properties()}. This class can have methods
4.9 * annotated by {@link ComputedProperty} which define derived
4.10 * properties in the model class.
4.11 * <p>
4.12 * The {@link #className() generated class}'s <code>toString</code>
4.13 * converts the state of the object into
4.14 - * <a href="http://en.wikipedia.org/wiki/JSON">JSON</a> format.
4.15 + * <a href="http://en.wikipedia.org/wiki/JSON">JSON</a> format.
4.16 + * <p>
4.17 + * An example where one defines class <code>Person</code> with three
4.18 + * properties (<code>firstName</code>, <code>lastName</code> and
4.19 + * <code>fullName</code>) follows:
4.20 + * <pre>
4.21 + * {@link Model @Model}(className="Person", properties={
4.22 + * {@link Property @Property}(name = "firstName", type=String.class),
4.23 + * {@link Property @Property}(name = "lastName", type=String.class)
4.24 + * })
4.25 + * static class PersonImpl {
4.26 + * {@link ComputedProperty @ComputedProperty}
4.27 + * static String fullName(String firstName, String lastName) {
4.28 + * return firstName + " " + lastName;
4.29 + * }
4.30 + * }
4.31 + * </pre>
4.32 *
4.33 * @author Jaroslav Tulach <jtulach@netbeans.org>
4.34 */
5.1 --- a/json/src/main/java/net/java/html/json/OnPropertyChange.java Tue Apr 23 16:16:45 2013 +0200
5.2 +++ b/json/src/main/java/net/java/html/json/OnPropertyChange.java Tue Apr 23 20:43:19 2013 +0200
5.3 @@ -25,8 +25,8 @@
5.4 import java.lang.annotation.RetentionPolicy;
5.5 import java.lang.annotation.Target;
5.6
5.7 -/** Represents a property. Either in a generated model of an HTML
5.8 - * {@link Page} or in a class defined by {@link Model}.
5.9 +/** Defines a method that is supposed to be notified when a
5.10 + * property defined by {@link Model} has been changed.
5.11 *
5.12 * @author Jaroslav Tulach <jtulach@netbeans.org>
5.13 */
6.1 --- a/json/src/main/java/net/java/html/json/OnReceive.java Tue Apr 23 16:16:45 2013 +0200
6.2 +++ b/json/src/main/java/net/java/html/json/OnReceive.java Tue Apr 23 20:43:19 2013 +0200
6.3 @@ -25,15 +25,15 @@
6.4 import java.lang.annotation.RetentionPolicy;
6.5 import java.lang.annotation.Target;
6.6
6.7 -/** Static methods in classes annotated by {@link Page}
6.8 +/** Static methods in classes annotated by {@link Model}
6.9 * can be marked by this annotation to establish a
6.10 * <a href="http://en.wikipedia.org/wiki/JSON">JSON</a>
6.11 * communication point.
6.12 - * The associated model page then gets new method to invoke a network
6.13 + * The associated model class then gets new method to invoke a network
6.14 * connection. Example follows:
6.15 *
6.16 * <pre>
6.17 - * {@link Page @Page}(className="MyModel", xhtml="page.html", properties={
6.18 + * {@link Model @Model}(className="MyModel", properties={
6.19 * {@link Property @Property}(name = "people", type=Person.class, array=true)
6.20 * })
6.21 * class MyModelImpl {
6.22 @@ -50,7 +50,7 @@
6.23 *
6.24 * {@link OnReceive @OnReceive}(url = "{protocol}://your.server.com/person/{name}")
6.25 * static void getANewPerson(MyModel m, Person p) {
6.26 - * {@link Element#alert Element.alert}("Adding " + p.getFullName() + '!');
6.27 + * alert("Adding " + p.getFullName() + '!');
6.28 * m.getPeople().add(p);
6.29 * }
6.30 *
6.31 @@ -59,7 +59,7 @@
6.32 * // which asynchronously contacts the server and in case of success calls
6.33 * // your {@link OnReceive @OnReceive} with parsed in data
6.34 *
6.35 - * {@link On @On}(event={@link OnEvent#CLICK OnEvent.CLICK}, id="rqst")
6.36 + * {@link Function @Function}
6.37 * static void requestSmith(MyModel m) {
6.38 * m.getANewPerson("http", "Smith");
6.39 * }
7.1 --- a/json/src/main/java/net/java/html/json/Property.java Tue Apr 23 16:16:45 2013 +0200
7.2 +++ b/json/src/main/java/net/java/html/json/Property.java Tue Apr 23 20:43:19 2013 +0200
7.3 @@ -25,8 +25,7 @@
7.4 import java.lang.annotation.Target;
7.5 import java.util.List;
7.6
7.7 -/** Represents a property. Either in a generated model of an HTML
7.8 - * {@link Page} or in a class defined by {@link Model}.
7.9 +/** Represents a property in a class defined with {@link Model} annotation.
7.10 *
7.11 * @author Jaroslav Tulach <jtulach@netbeans.org>
7.12 */
7.13 @@ -41,7 +40,7 @@
7.14 String name();
7.15
7.16 /** Type of the property. Can either be primitive type (like <code>int.class</code>,
7.17 - * <code>double.class</code>, etc.), {@link String} or complex model
7.18 + * <code>double.class</code>, etc.), {@link String}, {@link Enum enum} or complex model
7.19 * class (defined by {@link Model} property).
7.20 *
7.21 * @return the class of the property