Package | Class | Deprecated
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.makumba
Interface FieldDefinition

    public interface FieldDefinition

Information about a field from a makumba data definition as obtained from an MDD file. This class is provided for makumba programs to be able to introspect makumba data structures. Such introspection is not needed usually, as the application programmer knows the makumba data structure.

Field Summary
`static int` | `_binary`
`static int` | `_boolean`
`static int` | `_char`
`static int` | `_charEnum`
`static int` | `_date`
`static int` | `_dateCreate`
`static int` | `_dateModify`
`static int` | `_file`
`static int` | `_int`
`static int` | `_intEnum`
`static int` | `_nil`
`static int` | `_ptr`
`static int` | `_ptrIndex`
`static int` | `_ptrOne`
`static int` | `_ptrRel`
`static int` | `_real`
`static int` | `_set`
`static int` | `_setCharEnum`
`static int` | `_setComplex`
`static int` | `_setIntEnum`
`static int` | `_text`
`static String` | `ERROR_NOT_EMPTY`
`static String` | `ERROR_NOT_NULL`
`static String` | `ERROR_NOT_UNIQUE`

Method Summary
`void` | `addValidationRule(Collection<ValidationRule> rules)` adds several new validation rules to this field.
`void` | `addValidationRule(ValidationRule rule)` Adds a new validation rule to this field.
`void` | `checkInsert(Dictionary<String,Object> d)` check if the corresponding field from the dictionary can be inserted
`void` | `checkUpdate(Dictionary<String,Object> d)` check if the corresponding field from the dictionary can be updated
`Object` | `checkValue(Object value)` check if the value can be assigned
`Object` | `checkValueImpl(Object value)`
`DataDefinition` | `getDataDefinition()` The data definition that contains this field definition
`String` | `getDataType()` The data type of this field.
`Date` | `getDefaultDate()` Get the default value as a Date.
`int` | `getDefaultInt()` Get the default value as an integer.
`String` | `getDefaultString()` Get the default value as a String.
`Object` | `getDefaultValue()` returns the default value of this field
`Vector<String>` | `getDeprecatedValues()` returns the deprecated values for intEnum
`String` | `getDescription()` Returns field's description
`Object` | `getEmptyValue()` The value returned in case there is no value in the database and no default value is indicated
`int` | `getEnumeratorSize()` Get the number of the members of an enumerated field.
`DataDefinition` | `getForeignTable()` The type with which the ptr or set relation is defined.
`int` | `getIntAt(int i)` Get the integer at a certain position in an enumerated type.
`int` | `getIntegerType()` returns the integer value associated with the field's internal makumba type.
`Class<?>` | `getJavaType()` The Java type of this field.
`String` | `getName()` The name of this field, normally the same with the name of the field
`String` | `getNameAt(int i)` Get the name at a certain position in an enumerated field.
`String` | `getNameFor(int i)` Get the name for a certain value of the enumerated field Works only for intEnum
`Enumeration<String>` | `getNames()` Get the names of an enumerated field.
`Object` | `getNull()` The null value for this type
`FieldDefinition` | `getOriginalFieldDefinition()` The original field definition this field definition was made of, used e.g. in form responders.
`DataDefinition` | `getPointedType()` The type referred.
`String` | `getStringAt(int i)` Get the String value at a certain position in an enumerated field.
`DataDefinition` | `getSubtable()` The subtype created by an immediate ptr or set definition.
`String` | `getTitleField()` Get the alternative title field, if the title to be used is indicated specifically on a ptr or set.
`String` | `getType()` Returns field's internal makumba type.
`Collection<ValidationRule>` | `getValidationRules()` Returns all the validation rules connected to this field.
`Enumeration` | `getValues()` Get the values of an enumerated field.
`int` | `getWidth()` Get the maximum character width.
`boolean` | `hasDescription()` Tells wether this field has a description in the MDD
`boolean` | `hasTitleFieldIndicated()` Tells if the title to be used is indicated specifically on a ptr or set. works only for ptr and set types
`boolean` | `isAssignableFrom(FieldDefinition fd)` check compatibility with the given type
`boolean` | `isBinaryType()` returns whether this field is a binary type.
`boolean` | `isComplexSet()` returns whether this field is a setComplex.
`boolean` | `isDateType()` returns whether this field is a date type, i.e. date, or the default fields dateCreate and dateModify.
`boolean` | `isDefaultField()` returns whether this field is a default field generated by makumba.
`boolean` | `isEnumType()` returns whether this field is a simple enum type, i.e. intEnum or charEnum.
`boolean` | `isExternalSet()` returns whether this field is an external set, i.e. set ptr, but not setIntEnum, not setCharEnum nor setComplex.
`boolean` | `isFileType()` returns whether this field is a file type.
`boolean` | `isFixed()` tells whether this field is fixed
`boolean` | `isIndexPointerField()` Indicates whether this field is the index pointer field of the `DataDefinition` it belongs to.
`boolean` | `isIntegerType()` returns whether this field is an integer type.
`boolean` | `isInternalSet()` returns whether this field is any kind of internal set type, i.e. set, setIntEnum, setCharEnum and setComplex, but not set.
`boolean` | `isNotEmpty()` tells whether this field is not empty
`boolean` | `isNotNull()` tells whether this field is not null
`boolean` | `isNumberType()` returns whether this field is a number type, i.e. int or real.
`boolean` | `isPointer()` returns whether this field is a pointer.
`boolean` | `isRealType()` returns whether this field is a real type.
`boolean` | `isSetEnumType()` returns whether this field is a set enum type, i.e. setIntEnum or setCharEnum.
`boolean` | `isSetType()` returns whether this field is a set type, i.e. set, setIntEnum or setCharEnum or setComplex.
`boolean` | `isStringType()` returns whether this field is a string type, i.e. char or text.
`boolean` | `isUnique()` tells whether this field is unique
`boolean` | `shouldEditBySingleInput()` Indicates whether this field should be edited by a simple mak:input, or needs it's own form.

Field Detail

### _ptr

    static final int _ptr

See Also:
  Constant Field Values

### _ptrRel

    static final int _ptrRel

See Also:
  Constant Field Values

### _ptrOne

    static final int _ptrOne

See Also:
  Constant Field Values

### _ptrIndex

    static final int _ptrIndex

See Also:
  Constant Field Values

### _int

    static final int _int

See Also:
  Constant Field Values

### _intEnum

    static final int _intEnum

See Also:
  Constant Field Values

### _char

    static final int _char

See Also:
  Constant Field Values

### _charEnum

    static final int _charEnum

See Also:
  Constant Field Values

### _text

    static final int _text

See Also:
  Constant Field Values

### _date

    static final int _date

See Also:
  Constant Field Values

### _dateCreate

    static final int _dateCreate

See Also:
  Constant Field Values

### _dateModify

    static final int _dateModify

See Also:
  Constant Field Values

### _set

    static final int _set

See Also:
  Constant Field Values

### _setComplex

    static final int _setComplex

See Also:
  Constant Field Values

### _nil

    static final int _nil

See Also:
  Constant Field Values

### _real

    static final int _real

See Also:
  Constant Field Values

### _setCharEnum

    static final int _setCharEnum

See Also:
  Constant Field Values

### _setIntEnum

    static final int _setIntEnum

See Also:
  Constant Field Values

### _binary

    static final int _binary

See Also:
  Constant Field Values

### _boolean

    static final int _boolean

See Also:
  Constant Field Values

### _file

    static final int _file

See Also:
  Constant Field Values

### ERROR_NOT_NULL

    static final String ERROR_NOT_NULL

See Also:
  Constant Field Values

### ERROR_NOT_EMPTY

    static final String ERROR_NOT_EMPTY

See Also:
  Constant Field Values

### ERROR_NOT_UNIQUE

    static final String ERROR_NOT_UNIQUE

See Also:
  Constant Field Values

Method Detail

### getName

    String getName()

  The name of this field, normally the same with the name of the field

### getDataDefinition

    DataDefinition getDataDefinition()

  The data definition that contains this field definition

### getOriginalFieldDefinition

    FieldDefinition getOriginalFieldDefinition()

  The original field definition this field definition was made of, used e.g. in form responders.

### isIndexPointerField

    boolean isIndexPointerField()

  Indicates whether this field is the index pointer field of the `DataDefinition` it belongs to.

### getEmptyValue

    Object getEmptyValue()

  The value returned in case there is no value in the database and no default value is indicated

### getNull

    Object getNull()

  The null value for this type

### hasDescription

    boolean hasDescription()

  Tells wether this field has a description in the MDD

### getDescription

    String getDescription()

  Returns field's description

### getType

    String getType()

  Returns field's internal makumba type. Can be:
  - ptr: normal pointer
  - ptrRel: relational pointer (in automatically generated types such as middle types in set)
  - ptrOne: pointer to type defined on-the-spot
  - ptrIndex: primary key, automatically added
  - int: normal integer
  - intEnum: integer defined by enumeration
  - char: normal character
  - charEnum: character defined by enumeration
  - text: normal text
  - date: normal date
  - dateCreate: creation date, automatically added
  - dateModify: last modification date, automatically added
  - set: normal set in another table
  - setComplex: set of type defined on-the-spot
  - binary: binary data type (images, documents...)
  - boolean: boolean, can only take two values
  TODO nil and real and timeStamp need to be added???

### getIntegerType

    int getIntegerType()

  returns the integer value associated with the field's internal makumba type.

### getDataType

    String getDataType()

  The data type of this field. For example, intEnum and int both have int as data type

### getJavaType

    Class<?> getJavaType()

  The Java type of this field. For example, intEnum and int both have java.lang.Integer as data type

### isFixed

    boolean isFixed()

  tells whether this field is fixed

### isNotNull

    boolean isNotNull()

  tells whether this field is not null

### isNotEmpty

    boolean isNotEmpty()

  tells whether this field is not empty

### isUnique

    boolean isUnique()

  tells whether this field is unique

### getDefaultValue

    Object getDefaultValue()

  returns the default value of this field

### getDefaultString

    String getDefaultString()

  Get the default value as a String. Works only for char, text, charEnum, setcharEnum types

  Throws:
    `ClassCastException` - for other types

### getDefaultInt

    int getDefaultInt()

  Get the default value as an integer. Works only for int, intEnum types

  Throws:
    `ClassCastException` - for other types

### getDefaultDate

    Date getDefaultDate()

  Get the default value as a Date. Works only for date type

  Throws:
    `ClassCastException` - for other types

### getValues

    Enumeration getValues()

  Get the values of an enumerated field. Works only for intEnum, charEnum types.

  Throws:
    `ClassCastException` - for other types

### getNames

    Enumeration<String> getNames()

  Get the names of an enumerated field. Works only for intEnum, charEnum types

  Throws:
    `ClassCastException` - for other types

### getEnumeratorSize

    int getEnumeratorSize()

  Get the number of the members of an enumerated field. Works only for intEnum, charEnum types

  Throws:
    `ClassCastException` - for other types

### getStringAt

    String getStringAt(int i)

  Get the String value at a certain position in an enumerated field. Works only for intEnum, charEnum types

  Throws:
    `ClassCastException` - for other types

### getNameAt

    String getNameAt(int i)

  Get the name at a certain position in an enumerated field. Works only for intEnum, charEnum types

  Throws:
    `ClassCastException` - for other types

### getNameFor

    String getNameFor(int i)

  Get the name for a certain value of the enumerated field Works only for intEnum

  Throws:
    `ClassCastException` - for other types

### getIntAt

    int getIntAt(int i)

  Get the integer at a certain position in an enumerated type. Works only for intEnum types

  Throws:
    `ClassCastException` - for other types

### getWidth

    int getWidth()

  Get the maximum character width. Works only for char, charEnum, setcharEnum types

  Throws:
    `ClassCastException` - for other types

### getForeignTable

    DataDefinition getForeignTable()

  The type with which the ptr or set relation is defined. Works only for ptr, ptrRel and set types

  Returns:
    the foreign type indicated in set or ptr definition
  Throws:
    `ClassCastException` - for other types

### getSubtable

    DataDefinition getSubtable()

  The subtype created by an immediate ptr or set definition. Works only for ptrOne, set, setComplex types

  Returns:
    the subtype indicated in set or ptr definition
  Throws:
    `ClassCastException` - for other types

### getPointedType

    DataDefinition getPointedType()

  The type referred. Will return getRelationType() for ptr, ptrRel and set types and getSubtype() for ptrOne, set, setComplex types. Works only for ptrOne, set, setComplex types

  Returns:
    the subtype indicated in set or ptr definition
  Throws:
    `ClassCastException` - for other types

### getTitleField

    String getTitleField()

  Get the alternative title field, if the title to be used is indicated specifically on a ptr or set. Works only for ptr and set types

  Returns:
    title field of the record in the foreign table, as indicated in this field definition or in the respective foreign table record definition
  Throws:
    `ClassCastException` - for other types
  See Also:
    `DataDefinition.getTitleFieldName()`

### hasTitleFieldIndicated

    boolean hasTitleFieldIndicated()

  Tells if the title to be used is indicated specifically on a ptr or set. works only for ptr and set types

  Returns:
    whether the definition indicates a title field
  Throws:
    `ClassCastException` - for other types

### isAssignableFrom

    boolean isAssignableFrom(FieldDefinition fd)

  check compatibility with the given type

### checkValue

    Object checkValue(Object value)

  check if the value can be assigned

### checkValueImpl

    Object checkValueImpl(Object value)

### checkInsert

    void checkInsert(Dictionary<String,Object> d)

  check if the corresponding field from the dictionary can be inserted

### checkUpdate

    void checkUpdate(Dictionary<String,Object> d)

  check if the corresponding field from the dictionary can be updated

### getDeprecatedValues

    Vector<String> getDeprecatedValues()

  returns the deprecated values for intEnum

### isDefaultField

    boolean isDefaultField()

  returns whether this field is a default field generated by makumba.

### shouldEditBySingleInput

    boolean shouldEditBySingleInput()

  Indicates whether this field should be edited by a simple mak:input, or needs it's own form.

### isDateType

    boolean isDateType()

  returns whether this field is a date type, i.e. date, or the default fields dateCreate and dateModify.

### isNumberType

    boolean isNumberType()

  returns whether this field is a number type, i.e. int or real.

### isIntegerType

    boolean isIntegerType()

  returns whether this field is an integer type.

### isRealType

    boolean isRealType()

  returns whether this field is a real type.

### isBinaryType

    boolean isBinaryType()

  returns whether this field is a binary type.

### isFileType

    boolean isFileType()

  returns whether this field is a file type.

### isSetType

    boolean isSetType()

  returns whether this field is a set type, i.e. set, setIntEnum or setCharEnum or setComplex.

### isSetEnumType

    boolean isSetEnumType()

  returns whether this field is a set enum type, i.e. setIntEnum or setCharEnum.

### isEnumType

    boolean isEnumType()

  returns whether this field is a simple enum type, i.e. intEnum or charEnum.

### isInternalSet

    boolean isInternalSet()

  returns whether this field is any kind of internal set type, i.e. set, setIntEnum, setCharEnum and setComplex, but not set.

### isExternalSet

    boolean isExternalSet()

  returns whether this field is an external set, i.e. set ptr, but not setIntEnum, not setCharEnum nor setComplex.

### isComplexSet

    boolean isComplexSet()

  returns whether this field is a setComplex.

### isPointer

    boolean isPointer()

  returns whether this field is a pointer.

### isStringType

    boolean isStringType()

  returns whether this field is a string type, i.e. char or text.

### getValidationRules

    Collection<ValidationRule> getValidationRules()

  Returns all the validation rules connected to this field.

### addValidationRule

    void addValidationRule(ValidationRule rule)

  Adds a new validation rule to this field.

### addValidationRule

    void addValidationRule(Collection<ValidationRule> rules)

  adds several new validation rules to this field.

Package | Class | Deprecated
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Docs generated on 2009-02-25 14:20