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

## com.sun.mdm.index.objects.validation
Class FieldDescriptor

    java.lang.Object
      com.sun.mdm.index.objects.validation.FieldDescriptor

All Implemented Interfaces:
  FieldValidator

public class FieldDescriptor
extends java.lang.Object
implements FieldValidator

Field Summary
`static int` | `NONE` None
`static int` | `REQUIRED` Nillable
`static int` | `UPDATEABLE` Updatable

Constructor Summary
`FieldDescriptor(java.lang.String name)` Creates a new instance of Field
`FieldDescriptor(java.lang.String name, int dataType)`
`FieldDescriptor(java.lang.String name, int dataType, int attributes)`

Method Summary
`java.lang.String` | `getFieldDescription()` Get field description of this field
`java.lang.String` | `getFieldName()` Get field name of this field
`int` | `getFieldType()` Get field type of this field
`boolean` | `isRequired()` Get Required attribute of this field
`boolean` | `isUpdateable()` Get Updateable attribute of this field
`void` | `setAllAttributes(int attributes)` Set all attributes of this FieldDescriptor
`void` | `setAttribute(int fieldAttribute, boolean flag)` Set an attribute of this FieldDescriptor
`void` | `setFieldType(int dataType)` Set the FieldType of this FieldDescriptor
`java.lang.String` | `toString()`
`void` | `validate(ObjectField field, boolean newObject)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### NONE

    public static final int NONE

  None

  See Also:
    Constant Field Values

### REQUIRED

    public static final int REQUIRED

  Nillable

  See Also:
    Constant Field Values

### UPDATEABLE

    public static final int UPDATEABLE

  Updatable

  See Also:
    Constant Field Values

Constructor Detail

### FieldDescriptor

    public FieldDescriptor(java.lang.String name)
                    throws ValidationException

  Creates a new instance of Field

  Parameters:
    `name` - field name
  Throws:
    `ValidationException`
    `ValidationException` - if name is null

### FieldDescriptor

    public FieldDescriptor(java.lang.String name,
                           int dataType)
                    throws ValidationException

  Parameters:
    `name` - field name
    `dataType` - data type
  Throws:
    `ValidationException`
    `ValidationException` - if name is null

### FieldDescriptor

    public FieldDescriptor(java.lang.String name,
                           int dataType,
                           int attributes)
                    throws ValidationException

  Parameters:
    `name` - field name
    `dataType` - data type
    `attributes` - field attributes
  Throws:
    `ValidationException`
    `ValidationException` - if name is null

Method Detail

### getFieldDescription

    public java.lang.String getFieldDescription()

  Get field description of this field

  Returns:
    field description of this field

### getFieldName

    public java.lang.String getFieldName()

  Get field name of this field

  Returns:
    field name of this field

### getFieldType

    public int getFieldType()

  Get field type of this field

  Returns:
    field type of this field

### isRequired

    public boolean isRequired()

  Get Required attribute of this field

  Returns:
    true if value required ; false otherwise

### isUpdateable

    public boolean isUpdateable()

  Get Updateable attribute of this field

  Returns:
    true if this field can be updated; false otherwise

### setAllAttributes

    public void setAllAttributes(int attributes)

  Set all attributes of this FieldDescriptor

  Parameters:
    `attributes` - all attributes

### setAttribute

    public void setAttribute(int fieldAttribute,
                             boolean flag)

  Set an attribute of this FieldDescriptor

  Parameters:
    `fieldAttribute` - attribute
    `flag` - true or false

### setFieldType

    public void setFieldType(int dataType)
                      throws ValidationException

  Set the FieldType of this FieldDescriptor

  Parameters:
    `dataType` - field type
  Throws:
    `ValidationException` - if data type is not recognized

### toString

    public java.lang.String toString()

  Returns:
    a string of this field descriptor

### validate

    public void validate(ObjectField field,
                         boolean newObject)
                  throws ValidationException

  Description copied from interface: `FieldValidator`
  callback to validate a field

  Specified by:
    `validate` in interface `FieldValidator`
  Parameters:
    `field` - object field
    `newObject` - a new object
  Throws:
    `ValidationException` - if the value is missing for a required field or the spcefied filed is null

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

Sun Microsystems, Inc.