Class StructuredFieldValue

    • Field Detail

      • classId

        public static final int classId
    • Constructor Detail

    • Method Detail

      • getField

        public abstract Field getField​(String fieldName)
        Returns the named field object, or null if that field does not exist.
        Parameters:
        fieldName - The name of the field to return.
        Returns:
        The corresponding field, or null.
      • getFieldValue

        public abstract FieldValue getFieldValue​(Field field)
        Returns the value of the given field. If the field does not exist, this method returns null.
        Parameters:
        field - The field whose value to return.
        Returns:
        The value of the field, or null.
      • getFieldValue

        public FieldValue getFieldValue​(String fieldName)
        Convenience method to return the value of a named field. This is the same as calling getField(String), and using the returned value to call getFieldValue(Field). If the named field does not exist, this method returns null.
        Parameters:
        fieldName - The name of the field whose value to return.
        Returns:
        The value of the field, or null.
      • setFieldValue

        public FieldValue setFieldValue​(Field field,
                                        FieldValue value)
        Sets the value of the given field. The type of the value must match the type of this field, i.e.
        field.getDataType().getValueClass().isAssignableFrom(value.getClass())
        must be true.
        Parameters:
        field - The field whose value to set.
        value - The value to set.
        Returns:
        The previous value of the field, or null.
        Throws:
        IllegalArgumentException - If the value is not compatible with the field.
      • doSetFieldValue

        protected abstract void doSetFieldValue​(Field field,
                                                FieldValue value)
      • setFieldValue

        public FieldValue setFieldValue​(String fieldName,
                                        FieldValue value)
        Convenience method to set the value of a named field. This is the same as calling getField(String), and using the returned value to call setFieldValue(Field, FieldValue). If the named field does not exist, this method returns null.
        Parameters:
        fieldName - The name of the field whose value to set.
        value - The value to set.
        Returns:
        The previous value of the field, or null.
      • removeFieldValue

        public abstract FieldValue removeFieldValue​(Field field)
        Removes and returns a field value.
        Parameters:
        field - The field whose value to remove.
        Returns:
        The previous value of the field, or null.
      • removeFieldValue

        public FieldValue removeFieldValue​(String fieldName)
        Convenience method to remove the value of a named field. This is the same as calling getField(String), and using the returned value to call removeFieldValue(Field). If the named field does not exist, this method returns null.
        Parameters:
        fieldName - The name of the field whose value to remove.
        Returns:
        The previous value of the field, or null.
      • clear

        public abstract void clear()
        Specified by:
        clear in class FieldValue
      • getFieldCount

        public abstract int getFieldCount()
      • isGenerated

        protected boolean isGenerated()
        Generated Document subclasses should override this and return true. This is used instead of using class.getAnnotation(Generated.class), because that is so slow.
        Returns:
        true if in a concrete subtype of Document