Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.interview
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 java.lang.Object

Constructor Summary
`PropertiesQuestion.ValueConstraints()`
`PropertiesQuestion.ValueConstraints(boolean readonly, boolean visible)`

Method Summary
`boolean` | `isReadOnly()` Determine if this value is a read-only value.
`boolean` | `isUnsetAllowed()` Is an unset response allowed.
`java.lang.String` | `isValid(java.lang.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.
`boolean` | `isVisible()` 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 Detail

### PropertiesQuestion.ValueConstraints

    public PropertiesQuestion.ValueConstraints()

### PropertiesQuestion.ValueConstraints

    public PropertiesQuestion.ValueConstraints(boolean readonly,
                                               boolean visible)

Method Detail

### 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.

### 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.

### isReadOnly

    public boolean isReadOnly()

  Determine if this value is a read-only value. The default is false.

  Returns:
    True if read-only, false otherwise.

### isVisible

    public boolean isVisible()

  Is this property (and value) visible? True by default.

  Returns:
    True if it should be visible, false otherwise.

### 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:
    `isUnsetAllowed()`

### 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(boolean)`

### isValid

    public java.lang.String isValid(java.lang.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:
    `PropertiesQuestion.getInvalidKeys()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.