Interface Operation

  • All Superinterfaces:
    PropertyDescriptor

    public interface Operation
    extends PropertyDescriptor
    An implementation of an operation that may be invoked on an Attribute.
    Author:
    Jody Garnett, Refractions Research
    • Method Detail

      • getMaxOccurs

        int getMaxOccurs()
        Operations are not part of the structure.
        Specified by:
        getMaxOccurs in interface PropertyDescriptor
        Returns:
        0 in order to not trip up
      • getMinOccurs

        int getMinOccurs()
        Operations are not part of the structure.
        Specified by:
        getMinOccurs in interface PropertyDescriptor
        Returns:
        0 in order to not trip up
      • isImplemented

        boolean isImplemented()
        Indicates if invoke may be called.

        In order allow for faithful description of a software system we will need construct models dynamically at runtime, possibly when no implementation of this Operation is available. As an example when working with features in a web application some operations may only be available when being executed on a remote web processing service.

        Returns:
        true if invoke may be called.
      • invoke

        Object invoke​(Attribute target,
                      Object... params)
               throws InvocationTargetException
        Invoke this operation on an attribute using the provided parameters.

        The state of the attribute may be used and / or updated during the execution of the operation.

        Please check to ensure that isImplemented returns true before calling invoke.

        Parameters:
        target - Attribute this operation is being applied to, the state of this attribute may be changed by this operation.
        params - parameters used by the operation
        Returns:
        the result of the operation
        Throws:
        InvoationTargetException - if an error occurred while processing
        InvocationTargetException