From 65b0f08fd959bde2b9998f9236a3218c64b8ac84 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 14 May 2011 23:40:27 -0700 Subject: [PATCH] JavaDoc for properties classes. --- .../properties/FileGuacamoleProperty.java | 5 ++++ .../properties/GuacamoleProperties.java | 25 +++++++++++++++++++ .../properties/GuacamoleProperty.java | 24 +++++++++++++++++- .../properties/IntegerGuacamoleProperty.java | 5 ++++ .../properties/StringGuacamoleProperty.java | 5 ++++ 5 files changed, 63 insertions(+), 1 deletion(-) diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/FileGuacamoleProperty.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/FileGuacamoleProperty.java index c51e86dd8..7cdf8dbd9 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/FileGuacamoleProperty.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/FileGuacamoleProperty.java @@ -22,6 +22,11 @@ package net.sourceforge.guacamole.properties; import java.io.File; import net.sourceforge.guacamole.GuacamoleException; +/** + * A GuacamoleProperty whose value is a filename. + * + * @author Michael Jumper + */ public abstract class FileGuacamoleProperty implements GuacamoleProperty { @Override diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperties.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperties.java index fa1239bdf..820b50540 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperties.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperties.java @@ -24,10 +24,20 @@ import java.io.InputStream; import java.util.Properties; import net.sourceforge.guacamole.GuacamoleException; +/** + * Simple utility class for reading properties from the guacamole.properties + * file in the root of the classpath. + * + * @author Michael Jumper + */ public class GuacamoleProperties { private GuacamoleProperties() {} + /** + * The hostname of the server where guacd (the Guacamole proxy server) is + * running. + */ public static final StringGuacamoleProperty GUACD_HOSTNAME = new StringGuacamoleProperty() { @Override @@ -35,6 +45,9 @@ public class GuacamoleProperties { }; + /** + * The port that guacd (the Guacamole proxy server) is listening on. + */ public static final IntegerGuacamoleProperty GUACD_PORT = new IntegerGuacamoleProperty() { @Override @@ -64,6 +77,18 @@ public class GuacamoleProperties { } + /** + * Given a GuacamoleProperty, parses and returns the value set for that + * property in guacamole.properties, if any. + * + * @param The type that the given property is parsed into. + * @param property The property to read from guacamole.properties. + * @return The parsed value of the property as read from + * guacamole.properties. + * @throws GuacamoleException If an error occurs while parsing the value + * for the given property in + * guacamole.properties. + */ public static Type getProperty(GuacamoleProperty property) throws GuacamoleException { if (exception != null) diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperty.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperty.java index b32072554..145df86ff 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperty.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperty.java @@ -21,11 +21,33 @@ import net.sourceforge.guacamole.GuacamoleException; * along with this program. If not, see . */ - +/** + * An abstract representation of a property in the guacamole.properties file, + * which parses into a specific type. + * + * @author Michael Jumper + * @param The type this GuacamoleProperty will parse into. + */ public interface GuacamoleProperty { + /** + * Returns the name of the property in guacamole.properties that this + * GuacamoleProperty will parse. + * + * @return The name of the property in guacamole.properties that this + * GuacamoleProperty will parse. + */ public String getName(); + /** + * Parses the given string value into the type associated with this + * GuacamoleProperty. + * + * @param value The string value to parse. + * @return The parsed value. + * @throws GuacamoleException If an error occurs while parsing the + * provided value. + */ public Type parseValue(String value) throws GuacamoleException; } diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/IntegerGuacamoleProperty.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/IntegerGuacamoleProperty.java index 6c6919d08..570140778 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/IntegerGuacamoleProperty.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/IntegerGuacamoleProperty.java @@ -21,6 +21,11 @@ package net.sourceforge.guacamole.properties; import net.sourceforge.guacamole.GuacamoleException; +/** + * A GuacamoleProperty whose value is an integer. + * + * @author Michael Jumper + */ public abstract class IntegerGuacamoleProperty implements GuacamoleProperty { @Override diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/StringGuacamoleProperty.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/StringGuacamoleProperty.java index 05a3509ef..258a88571 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/StringGuacamoleProperty.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/StringGuacamoleProperty.java @@ -21,6 +21,11 @@ package net.sourceforge.guacamole.properties; import net.sourceforge.guacamole.GuacamoleException; +/** + * A GuacamoleProperty whose value is a simple string. + * + * @author Michael Jumper + */ public abstract class StringGuacamoleProperty implements GuacamoleProperty { @Override