Update of /var/cvs/src/org/mmbase/datatypes
In directory james.mmbase.org:/tmp/cvs-serv8736/src/org/mmbase/datatypes

Modified Files:
        DataTypeCollector.java BasicDataType.java DataType.java 
Log Message:
Added some javadoc


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/datatypes


Index: DataTypeCollector.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/datatypes/DataTypeCollector.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- DataTypeCollector.java      8 May 2007 15:18:25 -0000       1.14
+++ DataTypeCollector.java      16 Feb 2008 22:13:53 -0000      1.15
@@ -25,7 +25,7 @@
  *
  * @author Pierre van Rooden
  * @since  MMBase-1.8
- * @version $Id: DataTypeCollector.java,v 1.14 2007/05/08 15:18:25 michiel Exp 
$
+ * @version $Id: DataTypeCollector.java,v 1.15 2008/02/16 22:13:53 nklasens 
Exp $
  */
 
 public final class DataTypeCollector {
@@ -267,7 +267,7 @@
     }
 
     /**
-     * Unlock a dataType so it can be changed or latered.
+     * Unlock a dataType so it can be changed or altered.
      * This will likely fail if the datatype is not part of this collector.
      */
     public void rewrite(DataType<?> dataType) {
@@ -275,7 +275,7 @@
     }
 
     /**
-     * Lock a dataType so it can be changed or latered.
+     * Lock a dataType so it can be changed or altered.
      * This will likely fail if the datatype is not part of this collector.
      */
     public void finish(DataType<?> dataType) {


Index: BasicDataType.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/datatypes/BasicDataType.java,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -b -r1.82 -r1.83
--- BasicDataType.java  16 Sep 2007 17:55:28 -0000      1.82
+++ BasicDataType.java  16 Feb 2008 22:13:53 -0000      1.83
@@ -38,7 +38,7 @@
  * @author Pierre van Rooden
  * @author Michiel Meeuwissen
  * @since  MMBase-1.8
- * @version $Id: BasicDataType.java,v 1.82 2007/09/16 17:55:28 michiel Exp $
+ * @version $Id: BasicDataType.java,v 1.83 2008/02/16 22:13:53 nklasens Exp $
  */
 
 public class BasicDataType<C> extends AbstractDescriptor implements 
DataType<C>, Cloneable, Comparable<DataType<C>>, Descriptor {
@@ -402,21 +402,21 @@
     }
 
     /**
-     * @javadoc
+     * [EMAIL PROTECTED]
      */
     public void finish() {
         finish(new Object());
     }
 
     /**
-     * @javadoc
+     * [EMAIL PROTECTED]
      */
     public void finish(Object owner) {
         this.owner = owner;
     }
 
     /**
-     * @javadoc
+     * [EMAIL PROTECTED]
      */
     public DataType<C> rewrite(Object owner) {
         if (this.owner != null) {


Index: DataType.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/datatypes/DataType.java,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- DataType.java       28 Aug 2007 10:06:05 -0000      1.64
+++ DataType.java       16 Feb 2008 22:13:53 -0000      1.65
@@ -19,7 +19,7 @@
 
 /**
  * A value in MMBase (such as the value of a field, or function parameter) is 
associated with a
- * 'datatype'.  A DataType is actually an elaborated wrapper arround a Class 
object, but besides
+ * 'datatype'.  A DataType is actually an elaborated wrapper around a Class 
object, but besides
  * this basic type of the value, it also defines restrictions on the values, a 
default value,
  * Processors, and perhaps other properties (e.g. properties which describe 
indications for edit
  * tool implementations).
@@ -32,7 +32,8 @@
  * @author Pierre van Rooden
  * @author Michiel Meeuwissen
  * @since  MMBase-1.8
- * @version $Id: DataType.java,v 1.64 2007/08/28 10:06:05 michiel Exp $
+ * @version $Id: DataType.java,v 1.65 2008/02/16 22:13:53 nklasens Exp $
+ * @param <C> Class this DataType 
  */
 
 public interface DataType<C> extends Descriptor, Cloneable, 
Comparable<DataType<C>>, Serializable {
@@ -76,17 +77,19 @@
     static final int ENFORCE_NEVER    = 0;
 
     /**
-     * Returned by [EMAIL PROTECTED] #validate} if no errors: an empty 
(nonmodifiable) Collection.
+     * Returned by [EMAIL PROTECTED] #validate(Object, Node, Field)} if no 
errors: an empty (nonmodifiable) Collection.
      */
     public static final Collection<LocalizedString> VALID = 
Collections.emptyList();
 
     /**
      * Return the DataType from which this one inherited, or <code>null</code>
+     * @return inherited DataType
      */
     public DataType<?> getOrigin();
 
     /**
      * Return an identifier for the basic type (i.e., 'string', 'int', 
'datetime') supported by this datatype.
+     * @return identifier for the basic type
      */
     public String getBaseTypeIdentifier();
 
@@ -94,6 +97,7 @@
      * Return the datatype's basic (MMBase) type (i.e., STRING, INTEGER, 
DATETIME) as definied in the Field interface
      * Note that in some cases (i.e. with older clouds) this may differ from 
the basic type of the datatype's field,
      * which defines in what format the data is stored.
+     * @return identifier of the basic type
      * @see Field#getType
      */
     public int getBaseType();
@@ -120,6 +124,7 @@
      * @param value The value to be filled in a value with this DataType.
      * @param node  Sometimes a node might be needed.
      * @param field Sometimes a (or 'the') field might be needed.
+     * @return casted object of Class of this DataType
      */
     public C cast(Object value, Node node, Field field);
 
@@ -128,11 +133,16 @@
      * datatype, e.g. enumerations may get resolved (enumerations have the 
feature that they can
      * e.g. resolve java-constants to their values).
      *
-     * This does not garantuee that the value has the 'proper' type, but only 
that it now can be
-     * cast to the right type without further problems. ([EMAIL PROTECTED] 
org.mmbase.util.Casting#toType} should do).
+     * This does not guarantee that the value has the 'proper' type, but only 
that it now can be
+     * cast to the right type without further problems. ([EMAIL PROTECTED] 
org.mmbase.util.Casting#toType(Class, Object)} should do).
      *
      * preCast should not change the actual type of value. It is e.g. used in 
the
      * Node#setStringValue, and the processor may expect a String there.
+     * @param value The value to be filled in a value with this DataType.
+     * @param node  Sometimes a node might be needed.
+     * @param field Sometimes a (or 'the') field might be needed.
+     * @param <D> 
+     * @return converted value to be able to cast to the DataType of the field
      */
     public <D> D preCast(D value, Node node, Field field);
     //public Object preCast(Object value, Node node, Field field);
@@ -144,28 +154,34 @@
     public C getDefaultValue();
 
     /**
-     * @javadoc
+     * Set the default value for this DataType 
+     * @param def default value 
      */
     public void setDefaultValue(C def);
 
     /**
-     * @javadoc
+     * Unlock a DataType so it can be changed or altered.
+     * @param owner the object to finish datatypes with
+     * @return unlocked DataType
      */
     public DataType<C> rewrite(Object owner);
 
     /**
-     * @javadoc
+     * Is datatype locked
+     * @return <code>true</code> when datatype is locked
      */
     public boolean isFinished();
 
     /**
-     * @javadoc
+     * Lock a dataType so it can be changed or altered.
+     * @param owner the object to finish datatypes with
      */
     public void finish(Object owner);
 
     /**
      * The maximum enforce strength of all restrictions on this datatype.
-     * See [EMAIL PROTECTED] Restriction#ENFORCE_ALWAYS}, [EMAIL PROTECTED] 
DataType#ENFORCE_ALWAYS}, [EMAIL PROTECTED] DataType#ENFORCE_ONCHANGE}, [EMAIL 
PROTECTED] DataType#ENFORCE_NEVER}.
+     * See [EMAIL PROTECTED] DataType#ENFORCE_ALWAYS}, [EMAIL PROTECTED] 
DataType#ENFORCE_ONCHANGE}, [EMAIL PROTECTED] DataType#ENFORCE_NEVER}.
+     * @return maximum enforce strength
      */
     public int getEnforceStrength();
 
@@ -195,7 +211,7 @@
     public boolean isRequired();
 
     /**
-     * Returns the 'required' restriction, containing the value, 
errormessages, and fixed status of this attribute.
+     * Returns the 'required' restriction, containing the value, error 
messages, and fixed status of this attribute.
      * @return the restriction as a [EMAIL PROTECTED] DataType.Restriction}
      */
     public DataType.Restriction<Boolean> getRequiredRestriction();
@@ -203,7 +219,7 @@
     /**
      * Sets whether the data type requires a value, which means that it may 
not remain unfilled.
      * @param required <code>true</code> if a value is required
-     * @throws InvalidStateException if the datatype was finished (and thus 
can no longer be changed)
+     * @throws IllegalStateException if the datatype was finished (and thus 
can no longer be changed)
      */
     public void setRequired(boolean required);
 
@@ -227,7 +243,7 @@
     /**
      * Sets whether the data type requires a value.
      * @param unique <code>true</code> if a value is unique
-     * @throws InvalidStateException if the datatype was finished (and thus 
can no longer be changed)
+     * @throws IllegalStateException if the datatype was finished (and thus 
can no longer be changed)
      */
     public void setUnique(boolean unique);
 
@@ -243,12 +259,13 @@
      * @param cloud  Possibly the possible values depend on a cloud (security)
      * @param node   Possibly the possible values depend on an actual node 
(this may be, and in the default implementation is, ignored)
      * @param field   Possibly the possible values depend on an actual field 
(this may be, and in the default implementation is, ignored)
+     * @return iterator over all possible values for this datatype
      *
      */
     public Iterator<Map.Entry<C, String>> getEnumerationValues(Locale locale, 
Cloud cloud, Node node, Field field);
 
     /**
-     * Returns a (gui) value from a list of retsricted enumerated values, or
+     * Returns a (gui) value from a list of restricted enumerated values, or
      * <code>null</code> if no enumeration restrictions apply or teh value 
cannot be found.
      *
      * @param locale for which to produce
@@ -256,6 +273,7 @@
      * @param node   Possibly the possible values depend on an actual node 
(this may be, and in the default implementation is, ignored)
      * @param field  Possibly the possible values depend on an actual field 
(this may be, and in the default implementation is, ignored)
      * @param key    the key for which to look up the (gui) value
+     * @return a (gui) value from a list of restricted enumerated values
      */
     public String getEnumerationValue(Locale locale, Cloud cloud, Node node, 
Field field, Object key);
 
@@ -267,16 +285,19 @@
 
     /**
      * The enumeration for this datatype as a [EMAIL PROTECTED] Restriction}.
+     * @return enumeration for this datatype
      */
     public DataType.Restriction<LocalizedEntryListFactory<C>> 
getEnumerationRestriction();
 
     /**
-     * @javadoc
+     * Return the Commit processor of this datatype
+     * @return Commit processor
      */
     public CommitProcessor getCommitProcessor();
 
     /**
-     * @javadoc
+     * Set the Commit processor of this datatype
+     * @param cp Commit processor
      */
     public void setCommitProcessor(CommitProcessor cp);
 
@@ -284,6 +305,7 @@
      * Returns the default processor for this action
      * @param action either [EMAIL PROTECTED] #PROCESS_GET}, or [EMAIL 
PROTECTED] #PROCESS_SET}
      * XXX What exactly would be against getGetProcesor(), getSetProcessor() ?
+     * @return the default processor for this action
      */
     public Processor getProcessor(int action);
 
@@ -291,18 +313,21 @@
      * Returns the processor for this action and processing type
      * @param action either [EMAIL PROTECTED] #PROCESS_GET}, or [EMAIL 
PROTECTED] #PROCESS_SET}
      * @param processingType the MMBase type defining the type of value to 
process
+     * @return the processor for this action and processing type
      */
     public Processor getProcessor(int action, int processingType);
 
     /**
      * Sets the processor for this action
      * @param action either [EMAIL PROTECTED] #PROCESS_GET}, or [EMAIL 
PROTECTED] #PROCESS_SET}
+     * @param processor the processor for this action
      */
     public void setProcessor(int action, Processor processor);
 
     /**
      * Sets the processor for this action
      * @param action either [EMAIL PROTECTED] #PROCESS_GET}, or [EMAIL 
PROTECTED] #PROCESS_SET}
+     * @param processor the processor for this action and processing type
      * @param processingType the MMBase type defining the type of value to 
process
      */
     public void setProcessor(int action, Processor processor, int 
processingType);
@@ -311,6 +336,7 @@
      * Returns a cloned instance of this datatype, inheriting all validation 
rules.
      * Unlike the original datatype though, the cloned copy is declared 
unfinished even if the original
      * was finished. This means that the cloned datatype can be changed.
+     * @return cloned instance
      */
     public Object clone();
 
@@ -318,12 +344,14 @@
      * Returns a cloned instance of this datatype, inheriting all validation 
rules.
      * Similar to calling clone(), but changes the data type name if one is 
provided.
      * @param name the new name of the copied datatype (can be 
<code>null</code>, in which case the name is not changed).
+     * @return cloned DataType
      */
     public DataType<C> clone(String name);
 
 
     /**
      * Returns a DOM element describing this DataType.
+     * @return a DOM element describing this DataType.
      * @todo EXPERIMENTAL.
      */
     public org.w3c.dom.Element toXml();
@@ -338,22 +366,25 @@
 
     /**
      * A restriction controls (one aspect of) the acceptable values of a 
DataType. A DataType generally has several restrictions.
+     * @param <D> Type of Value describing the restriction
      */
     public interface Restriction<D extends Serializable> extends Serializable {
 
         /**
-         * @javadoc
+         * @return Name of datatype
          */
         public String getName();
 
         /**
          * A Value describing the restriction, so depending on the semantics 
of this restriction, it
          * can have virtually every type (as long as it is Serializable)
+         * @return A Value describing the restriction
          */
         public D getValue();
 
         /**
-         * @javadoc
+         * Set the Value describing the restriction
+         * @param value The instanc for the Value
          */
         public void setValue(D value);
 
@@ -361,11 +392,13 @@
          * If the restriction does not hold, the following error description 
can be used. On default
          * these descriptions are searched in a resource bundle based on the 
name of this
          * restriction.
+         * @return error description
          */
         public LocalizedString getErrorDescription();
 
         /**
-         * @javadoc
+         * Set error description for this restriction
+         * @param errorDescription description of error
          */
         public void setErrorDescription(LocalizedString errorDescription);
 
@@ -382,16 +415,19 @@
 
         /**
          * If a restriction is 'fixed', the value and error-description cannot 
be changed any more.
+         * @param fixed
          */
         public void setFixed(boolean fixed);
 
         /**
          * See [EMAIL PROTECTED] DataType#ENFORCE_ALWAYS}, [EMAIL PROTECTED] 
DataType#ENFORCE_ONCHANGE}, [EMAIL PROTECTED] DataType#ENFORCE_NEVER}.
+         * @return enforce strength
          */
         public int getEnforceStrength();
 
         /**
-         * @javadoc
+         * Set enforce strength
+         * @param v value of [EMAIL PROTECTED] DataType#ENFORCE_ALWAYS}, 
[EMAIL PROTECTED] DataType#ENFORCE_ONCHANGE}, [EMAIL PROTECTED] 
DataType#ENFORCE_NEVER}.
          */
         public void setEnforceStrength(int v);
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to