Class PropertiesQuestion.ValueConstraints

java.lang.Object
com.sun.interview.PropertiesQuestion.ValueConstraints
Direct Known Subclasses:
PropertiesQuestion.BooleanConstraints, PropertiesQuestion.FilenameConstraints, PropertiesQuestion.FloatConstraints, PropertiesQuestion.IntConstraints, PropertiesQuestion.StringConstraints
Enclosing class:
PropertiesQuestion

public static class PropertiesQuestion.ValueConstraints extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ValueConstraints(boolean readonly, boolean visible)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determine if this value is a read-only value.
    boolean
    Is an unset response allowed.
    Is the given value valid for this field? Since this constraint class has no particular typing, the default only check that the value is non-empty.
    boolean
    Is this property (and value) visible? True by default.
    void
    setReadOnly(boolean state)
    Determine whether this value should be readable only, by the interview user.
    void
    setUnsetAllowed(boolean state)
    May the answer be set to an unanswered state.
    void
    setVisible(boolean state)
    Make value outwardly visible or invisible.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ValueConstraints

      public ValueConstraints()
    • ValueConstraints

      public ValueConstraints(boolean readonly, boolean visible)
  • Method Details

    • isReadOnly

      public boolean isReadOnly()
      Determine if this value is a read-only value. The default is false.
      Returns:
      True if read-only, false otherwise.
    • setReadOnly

      public void setReadOnly(boolean state)
      Determine whether this value should be readable only, by the interview user. The default state is false.
      Parameters:
      state - True if readonly, false otherwise.
    • isVisible

      public boolean isVisible()
      Is this property (and value) visible? True by default.
      Returns:
      True if it should be visible, false otherwise.
    • setVisible

      public void setVisible(boolean state)
      Make value outwardly visible or invisible. This does not mean it is not accessible, just that it is not shown when possible in the user interfaces. The default state is true.
      Parameters:
      state - True if the property at constrained by this object should be visible.
    • isUnsetAllowed

      public boolean isUnsetAllowed()
      Is an unset response allowed. The default is true, unless indicated otherwise by a subclass.
      Returns:
      True if the unsetting the answer is allowed.
      See Also:
    • setUnsetAllowed

      public void setUnsetAllowed(boolean state)
      May the answer be set to an unanswered state. If false, the question will always be answered. If true, the question may be set to an affirmative, negative or unset response. An unset response is considered an incomplete answer by default.
      Parameters:
      state - True if the user is allowed to make this value unset.
      See Also:
    • isValid

      public String isValid(String v)
      Is the given value valid for this field? Since this constraint class has no particular typing, the default only check that the value is non-empty. You may override this method to do custom checking, or you may do your checking in getInvalidKeys() which by default defers to the associated constraint object (if any).
      Parameters:
      v - The value to check.
      Returns:
      Null if the valid is valid, a localized reason string otherwise.
      See Also: