Class Field

  • All Implemented Interfaces:
    Peer
    Direct Known Subclasses:
    FormField

    public class Field
    extends Container
    A class to represent the XFA field object. A field describes a container capable of capturing and presenting data content.
    • Constructor Detail

      • Field

        public Field​(Element parent,
                     Node prevSibling)
        Instantiates a field container.
        Parameters:
        parent - the field's parent, if any.
        prevSibling - the field's previous sibling, if any.
    • Method Detail

      • clearItems

        public void clearItems()
      • deleteItem

        public boolean deleteItem​(int nIndex)
        Delete an item at an index
        Parameters:
        nIndex - - the index to delete
        Returns:
        true if deleted.
      • execEvent

        public void execEvent​(java.lang.String sActivity)
      • execValidate

        public boolean execValidate()
      • getAttribute

        public Attribute getAttribute​(int eTag,
                                      boolean bPeek,
                                      boolean bValidate)
        Description copied from class: Element
        Gets this element's attribute whose attribute tag is given.

        To peek at an attribute, set the peek argument to true. If the attribute is present, it is returned; otherwise null is returned.

        To create an attribute, set the peek argument to false. If the attribute is absent, a default attribute is created and returned; for attributes with no default, null is returned.

        If validation argument is true, and the validation fails, this method throws.

        Overrides:
        getAttribute in class Container
        Parameters:
        eTag - the tag of the attribute.
        bPeek - whether to peek at the attribute or not.
        bValidate - whether to validate the attribute or not.
        Returns:
        the attribute.
      • getDataNode

        public DataNode getDataNode()
      • getFormattedValue

        public java.lang.String getFormattedValue()
        Gets the formatted value for this field. The returned formatted value will be either
        • the field's format picture representation, or,
        • the field's default locale picture representation, or,
        • any representation for works-in-progress.
        Returns:
        the formatted value for this field, or null if the content is null.
      • getItemLists

        public void getItemLists​(boolean bPeek,
                                 Field.ItemPair items,
                                 boolean bEnforceMultiColumn)
        Get the display and save lists
        Parameters:
        bPeek - - if TRUE return lists that must not be modified
        items - - a structure holding the bound and display elements
        bEnforceMultiColumn - -
      • getNeutralValue

        public java.lang.String getNeutralValue()
        Get the neutral value of this field
        Returns:
        String for Neutral value, null if undefined. This method is for checkbutton fields only.
      • getOffValue

        public java.lang.String getOffValue()
        Get the off value of this field
        Returns:
        The Off value. If none, null This method is for checkbutton fields only.
      • getOnValue

        public java.lang.String getOnValue()
        Get the on value of this field
        Returns:
        The On value, null if there isn't one. This method is for checkbutton fields only.
      • getRawValue

        public java.lang.String getRawValue()
        Gets the raw value for this field. The returned unformatted value will be either
        • the field's canonical representation, or,
        • any representation for works-in-progress.
        Returns:
        the unformatted raw value for this field, or null if the content is null.
      • hasValidFormattedValue

        public boolean hasValidFormattedValue()
      • isHeightGrowSupported

        public boolean isHeightGrowSupported()
        Description copied from class: Container
        Returns whether or not this container support growable heights. This does not indicate whether the container height is currently growable, just whether it's supported by this container type.
        Overrides:
        isHeightGrowSupported in class Container
      • isWidthGrowSupported

        public boolean isWidthGrowSupported()
        Description copied from class: Container
        Return whether or not this container support growable widths This does not indicate whether the container height is currently growable, just whether it's supported by this container type.

        Comments Helps distinguish - ie text draws supporting growing but arc draws do not.

        Overrides:
        isWidthGrowSupported in class Container
      • setFormattedValue

        public void setFormattedValue​(java.lang.String sValue)
        Set the formatted value for this field.
        Parameters:
        sValue - the formatted value for this field.
        Throws:
        java.lang.UnsupportedOperationException - if you try and set the value of a boilerplate content. The given formatted value should be in the either
        • in the field's format picture representation, or,
        • in the field's default locale picture representation, or,
        • in any representation for works-in-progress.
        If the given formatted value can be successfully unformatted into its canonical representation, then the field's raw value is set to this canonical representation. Otherwise the field's raw value is set to the given formatted value.
      • setIsNull

        public void setIsNull​(boolean bNull,
                              boolean bNotify)
        Set this node to contain a null value.
        Parameters:
        bNull - true if the node contains a null value, false otherwise.
      • setOn

        public void setOn​(boolean bOn)
        Set whether or not this container is 'on' in its ExclGroup
        Parameters:
        bOn - true if this container is 'on', false if the is not 'on'.
      • setRawValue

        public void setRawValue​(java.lang.String sString)
        Set the raw value for this field, no formatting.
        Parameters:
        sString - the unformatted raw value for this field.
        Throws:
        java.lang.UnsupportedOperationException - if you try and set the value of a boilerplate content. The given unformatted value should be in the either
        • in the field's canonical representation, or,
        • in any representation for works-in-progress.