net.aavalla.utils.jobpool.parameters
Class ParameterCollection

java.lang.Object
  extended by net.aavalla.utils.jobpool.parameters.ParameterCollection
All Implemented Interfaces:
java.lang.Iterable<FieldInstance>
Direct Known Subclasses:
VennExportParameters, VennParameters

public abstract class ParameterCollection
extends java.lang.Object
implements java.lang.Iterable<FieldInstance>

Author:
Lari Natri

Constructor Summary
ParameterCollection()
           
 
Method Summary
 boolean clearHiddenFields()
          Unhides all fields ie clears the hide set.
 boolean copyHiddenFieldsSetFrom(ParameterCollection from)
          Copies the hidden field set from the clone of the hidden fields set in the ParameterCollection given as parameter.
 java.lang.String getDescription()
          Returns the description of this ParameterCollection
 java.lang.String getHelpID()
           
 java.net.URL getHelpURL()
           
 java.util.HashSet<java.lang.String> getHiddenFields()
          Returns a clone of the hidden fields set.
 boolean hideFieldByName(java.lang.String fName)
          Hides a field from user editing, but does not remove it's value.
 boolean isFinal()
           
 java.util.ListIterator<FieldInstance> iterator()
           
 boolean makeFinal()
           
 java.util.Vector<FieldInstance> parseFieldsWithAnnotations(java.lang.Object obj)
           
 void setDescription(java.lang.String description)
           
 void setHelpID(java.lang.String helpID)
           
 void setHelpURL(java.net.URL helpURL)
           
 boolean unHideFieldByName(java.lang.String fName)
          Unhides ie removes a field from hide set.
 java.lang.String validateFieldRelations()
          This ought to validate the relations of all annotated fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterCollection

public ParameterCollection()
Method Detail

makeFinal

public final boolean makeFinal()

isFinal

public final boolean isFinal()

getDescription

public final java.lang.String getDescription()
Returns the description of this ParameterCollection

Returns:
Text to be displayed in the UI

validateFieldRelations

public java.lang.String validateFieldRelations()
This ought to validate the relations of all annotated fields. It should be called from UI parameter handler after all individual fields have been validated. For individual field validation, use classes derived from ParameterValidator. Derived classes should overwrite this method. The default implementation only returns null signifying that parameter collection is valid.

Returns:
null if validation ok, reason as a string if not

getHelpID

public final java.lang.String getHelpID()

getHelpURL

public final java.net.URL getHelpURL()

iterator

public final java.util.ListIterator<FieldInstance> iterator()
Specified by:
iterator in interface java.lang.Iterable<FieldInstance>

parseFieldsWithAnnotations

public final java.util.Vector<FieldInstance> parseFieldsWithAnnotations(java.lang.Object obj)

setDescription

public final void setDescription(java.lang.String description)

setHelpID

public final void setHelpID(java.lang.String helpID)

setHelpURL

public final void setHelpURL(java.net.URL helpURL)

hideFieldByName

public final boolean hideFieldByName(java.lang.String fName)
Hides a field from user editing, but does not remove it's value. Should be called before passing this ParameterCollection to a ParameterDialog.

Parameters:
fName - Name of the field as in annotation 'name'
Returns:
true if field did not exist in hide set and is now added to it

unHideFieldByName

public final boolean unHideFieldByName(java.lang.String fName)
Unhides ie removes a field from hide set. Should be called before passing this ParameterCollection to a ParameterDialog.

Parameters:
fName - Name of the field as in annotation 'name'
Returns:
true if field existed in hide set and is now removed

clearHiddenFields

public final boolean clearHiddenFields()
Unhides all fields ie clears the hide set.

Returns:
true if some fields were hidden before calling this

getHiddenFields

public final java.util.HashSet<java.lang.String> getHiddenFields()
Returns a clone of the hidden fields set.

Returns:

copyHiddenFieldsSetFrom

public final boolean copyHiddenFieldsSetFrom(ParameterCollection from)
Copies the hidden field set from the clone of the hidden fields set in the ParameterCollection given as parameter. Overwrites current hidden fields in this.

Parameters:
from - source for copying
Returns:
true if some change was made, false otherwise