Class FieldImpl

java.lang.Object
org.nuxeo.ecm.core.schema.types.FieldImpl
All Implemented Interfaces:
Serializable, Field

public class FieldImpl extends Object implements Field
The implementation for a field, which is the association of a type, a name, and default values.
See Also:
  • Constructor Details

  • Method Details

    • getDeclaringType

      public Type getDeclaringType()
      Description copied from interface: Field
      Gets the complex type or list type that declared this field.

      The declaring type may differ from the complex type owning this field.

      For example, in the case of a derived complex type, the field is owned by both the derived type and the base type, but it's declared only by the base type.

      Specified by:
      getDeclaringType in interface Field
      Returns:
      the complex that declared this field
    • getName

      public QName getName()
      Description copied from interface: Field
      Gets the field name.
      Specified by:
      getName in interface Field
      Returns:
      the field name
    • getType

      public Type getType()
      Description copied from interface: Field
      Gets the field type.
      Specified by:
      getType in interface Field
      Returns:
      the field type
    • getDefaultValue

      public Object getDefaultValue()
      Description copied from interface: Field
      Gets this field default value or null if none.
      Specified by:
      getDefaultValue in interface Field
      Returns:
      the default value if any was specified, null otherwise
    • isNillable

      public boolean isNillable()
      Description copied from interface: Field
      Checks whether this field is nillable (can have null values).
      Specified by:
      isNillable in interface Field
      Returns:
      true if the field can have null values
    • isConstant

      public boolean isConstant()
      Description copied from interface: Field
      Checks whether this field is constant (is read only).
      Specified by:
      isConstant in interface Field
      Returns:
      true if the field is constant false otherwise
    • setDefaultValue

      public void setDefaultValue(String value)
      Description copied from interface: Field
      Sets the default value of this field.
      Specified by:
      setDefaultValue in interface Field
      Parameters:
      value - the value to set
    • setNillable

      public void setNillable(boolean isNillable)
      Description copied from interface: Field
      Sets the nillable flag.
      Specified by:
      setNillable in interface Field
    • setConstant

      public void setConstant(boolean isConstant)
      Description copied from interface: Field
      Sets the constant flag.
      Specified by:
      setConstant in interface Field
    • getMaxOccurs

      public int getMaxOccurs()
      Description copied from interface: Field
      Gets the maximum number this field may occurs in the owner type.

      By default this is 1. -1 is returned if not a maximum limit is imposed.

      Specified by:
      getMaxOccurs in interface Field
      Returns:
      the max occurrences
    • getMinOccurs

      public int getMinOccurs()
      Description copied from interface: Field
      Gets the minimum number this field may occurs in the owner type.

      By default this is 1.

      Specified by:
      getMinOccurs in interface Field
      Returns:
      the min occurrences
    • setMaxOccurs

      public void setMaxOccurs(int max)
      Description copied from interface: Field
      Sets max number of occurrences for this field.
      Specified by:
      setMaxOccurs in interface Field
      Parameters:
      max - max number of occurrences
    • setMinOccurs

      public void setMinOccurs(int min)
      Description copied from interface: Field
      Sets min number of occurrences for this field.
      Specified by:
      setMinOccurs in interface Field
      Parameters:
      min - min number of occurrences
    • getMaxLength

      public int getMaxLength()
      Description copied from interface: Field
      Gets the maximum length for this field.

      Value -1 means no constraint.

      Specified by:
      getMaxLength in interface Field
      Returns:
      the length
    • setMaxLength

      public void setMaxLength(int length)
      Description copied from interface: Field
      Sets the maximum length for this field.
      Specified by:
      setMaxLength in interface Field
      Parameters:
      length - the length, or -1 for no constraint
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getConstraints

      public Set<Constraint> getConstraints()
      Specified by:
      getConstraints in interface Field
      Returns:
      The constraints applied to this field.