Class AcroRadioButtonGroupField

    • Method Detail

      • getPossibleValues

        public Set getPossibleValues()
        Returns a set of the possible values that may be set on this button. These values are derived from the set of names of possible appearances that are available for this button. All possible values must be Strings.
      • setValue

        public boolean setValue​(String val)
                         throws IllegalArgumentException
        Sets the value of this button field. The provided String must be in the set of possible values for this field (see getPossibleValues() or null (i.e. no buttons in the radio button group should be selected).
        Specified by:
        setValue in interface AcroFormField
        Returns:
        true if the value of this field has been changed; false is returned if the provided value is the same as the current value, and no change has been made
        Throws:
        IllegalArgumentException - if a String is provided that is not in the set returned by getPossibleValues().
      • canChangeValue

        public boolean canChangeValue()
        This function always returns true.
        Specified by:
        canChangeValue in interface AcroFormField
      • bounds

        public Region bounds()
        Returns the region on the page where this radio button group is positioned.

        Since radio groups are an abstract construct — they are not rendered in any way, they only modify the behaviour and semantics of their constituent radio buttons — radio groups have no declared bounds of their own. Therefore, this method returns the union of the bounds of all the radio group's buttons.

        Specified by:
        bounds in interface Bounded
      • pageNumber

        public int pageNumber()
        Description copied from interface: DocumentLocation
        This page number is 0-indexed, and may be used to retrieve a Page object representing the page's content using the Document.getPage(int) function.

        If a page number is not available for some reason, then this method will return -1.

        Specified by:
        pageNumber in interface DocumentLocation
      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: AcroFormField
        Returns true only if this field is designated as read-only. Note that this is just a hint, provided for the benefit of end-user tools. PDFxStream does not enforce the read-only state of a form field; i.e. it will allow a field's value to be set even if it is designated as read-only.
        Specified by:
        isReadOnly in interface AcroFormField
      • getDefaultValue

        public Object getDefaultValue()
        Description copied from interface: AcroFormField
        Returns the default value to which the field reverts when a reset-form action is executed, as specified in the /DV entry in this field's PDF dictionary. The type of the returned object will be the same as the type of object returned by the AcroFormField.getValue() function, and depends upon the type of this field.
        Specified by:
        getDefaultValue in interface AcroFormField
      • getFullName

        public String getFullName()
        Description copied from interface: AcroFormField

        Returns the fully-qualified name of this field, which should be unique within a PDF document form. Details of how full names are constructed are specified in Section 8.6.2 (Field Names) of the PDF Document Specification.

        It suffices to say here that form fields in an interactive AcroForm are defined in a hierarchical manner, and that their local names are used to derive a period-delimited full name that guarantees each name's uniqueness within the parent AcroForm.

        Specified by:
        getFullName in interface AcroFormField
      • getLocalName

        public String getLocalName()
        Description copied from interface: AcroFormField
        Returns the local name of the field, as specified in the /T entry in this field's PDF dictionary. This name is also used as the value returned by the FormField.getName() implementation.
        Specified by:
        getLocalName in interface AcroFormField
      • getMappingName

        public String getMappingName()
        Description copied from interface: AcroFormField
        Returns the 'mapping name' of this field, as specified in the /TM entry in this field's PDF dictionary. The mapping name is used to identify the field in exported form data formats. This function can return null if no mapping name is defined.
        Specified by:
        getMappingName in interface AcroFormField
      • getName

        public String getName()
        Description copied from interface: FormField
        Returns the canonical name of this field. Only one FormField instance with a particular name should be available from a Form instance.
        Specified by:
        getName in interface FormField
      • getType

        public Object getType()
        Description copied from interface: AcroFormField
        Returns the type of field, as specified in the /FT entry in this field's PDF dictionary. This is an indication of the subtype of this AcroFormField instance:
        • If the return value is FIELD_TYPE_BUTTON, then this AcroFormField is an instance of AcroButtonField
        • If the return value is FIELD_TYPE_TEXT, then this AcroFormField is an instance of AcroTextField
        • If the return value is FIELD_TYPE_CHOICE, then this AcroFormField is an instance of AcroChoiceField
        • If the return value is FIELD_TYPE_SIGNATURE, then this AcroFormField is an instance of AcroSignatureField
        • If the return value is FIELD_TYPE_OTHER, then this AcroFormField has no specific concrete implementation. This case is reserved for form fields with new type indicators that may be introduced by Adobe in the future.
        Specified by:
        getType in interface AcroFormField
      • hasValueChanged

        public boolean hasValueChanged()
        Description copied from interface: AcroFormField
        Returns true only if this field's value has been changed since being loaded from the PDF document.
        Specified by:
        hasValueChanged in interface AcroFormField
      • getUIName

        public String getUIName()
        Description copied from interface: AcroFormField

        Returns the user-friendly name of this field, as specified in the /TU entry in this field's PDF dictionary. This function can return null if no user-friendly field name is defined.

        Specified by:
        getUIName in interface AcroFormField
        Specified by:
        getUIName in interface FormField