Package com.adobe.xfa

Class Arg

java.lang.Object
com.adobe.xfa.Arg

public final class Arg extends Object
This class represents an argument to a function or a return value. Instances of this class are primarily for use in scripting environments.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Arg()
    Instantiates an empty arg object.
    Arg(Arg src)
    Instantiates a copy of the given arg object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    assign(Arg src)
    Assigns the given arg object to this arg.
    void
    Set this argument to be empty
    boolean
    equals(Object object)
    Comparison operator -- equality
    int
    Return the argument type
    getAsBool(boolean bThrowException)
    Get the value as a boolean.
    getAsString(boolean bThrowException)
    Get the value in the form of a string.
    Return the boolean value held by this argument
    getDouble(boolean bStrongTyping)
    Return the double value held by this argument
    Return the exception held by this argument.
    Return the integer held by this argument
    Return the object held by this argument.
    Return the string value held by this argument
    getVoid(boolean bThrowException)
    Return the data object held by this argument.
    int
    Returns a hash code value for the object.
    boolean
    isCompatibleWith(int eType)
    Return the this Arg is compatible with a given type
    boolean
    Find out if this argument is empty
    boolean
    Is the current Object a reference/pointer to another Object.
    boolean
    Is the current Object resolved through property.
    void
    Assign this argument to a boolean
    void
    Assign this argument to a double
    void
    Assign this argument to an exception (representing an error)
    void
    Assign this argument to an integer
    void
    Set this argument to be NULL
    void
    Assign this argument to a given XFA object
    void
    setObject(Obj obj, boolean bIsRef)
    Assign this argument to a given XFA object
    void
    setObject(Obj obj, boolean bIsRef, boolean bIsProp)
    Assign this argument to a given XFA object
    void
    Assign this argument to a string
    void
    setVoid(Object oData)
    Assign this argument to a data object..

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Arg

      public Arg()
      Instantiates an empty arg object.
    • Arg

      public Arg(Arg src)
      Instantiates a copy of the given arg object.
      Parameters:
      src - The Arg to be copied.
  • Method Details

    • assign

      public void assign(Arg src)
      Assigns the given arg object to this arg. This is the assignment operator.
    • empty

      public void empty()
      Set this argument to be empty
    • equals

      public boolean equals(Object object)
      Comparison operator -- equality
      Overrides:
      equals in class Object
      Parameters:
      object - the object to compare
      Returns:
      true if this object equals the given.
    • hashCode

      public int hashCode()
      Returns a hash code value for the object. This method is unsupported.
      Overrides:
      hashCode in class Object
    • getArgType

      public int getArgType()
      Return the argument type
      Returns:
      our argument type as an XFAArgType
    • getAsBool

      public Boolean getAsBool(boolean bThrowException)
      Get the value as a boolean. This involves interpreting the various types as described below.

      This is a convenience function. It checks the current type of this Arg, and returns a boolean value which best represents the current value according to the following criteria:
       
             Current Type:    Returned Value:
             EMPTY            FALSE
             NULL             FALSE
             BOOL,            result of getBool()
             INTEGER,         TRUE if non-zero, FALSE otherwise
             DOUBLE,          TRUE if non-zero, FALSE otherwise
             STRING,          TRUE if string represents a non-zero number, FALSE otherwise
             OBJECT,          TRUE if object is non-NULL, FALSE otherwise
             EXCEPTION        FALSE
        
       
      The parameter bThrowException only affects the behaviour if the current value of this Arg is of type EXCEPTION. If bThrowException is FALSE, then this routine will simply return FALSE. If bThrowException is TRUE, then an exception will be thrown which contains the error message of the exception. This can simplify processing for an application.
      Parameters:
      bThrowException - when type is EXCEPTION; if TRUE: throws an exception, if FALSE: returns FALSE
      Returns:
      the value of this Arg as a boolean
    • getAsString

      public String getAsString(boolean bThrowException)
      Get the value in the form of a string.

      This is a convenience function. It checks the current type of this Arg, and returns a string which represents the current value according to the following examples:

       
             Current Type:    Returned String (example):
             EMPTY            "Empty"
             NULL             "Null"
             BOOL,            "True" or "False"
             INTEGER,         "123"
             DOUBLE,          "123.45"
             STRING,          (the same string)
             OBJECT,          "Object45" (i.e. "Object" with the ID value)
             EXCEPTION        "Error: " + error message
        
       
      The parameter bThrowException only affects the behaviour if the current value of this Arg is of type EXCEPTION. If bThrowException is FALSE, then this routine will simply return a string representing the exception. If bThrowException is TRUE, then an exception will be thrown which contains the error message of the exception. This can simplify processing for an application.
      Parameters:
      bThrowException - when type is EXCEPTION; if TRUE: throws an exception, if FALSE: returns an error message
      Returns:
      the value of this Arg in the form of a string
    • getBool

      public Boolean getBool()
      Return the boolean value held by this argument
      Returns:
      Our boolean value
    • getDouble

      public Double getDouble(boolean bStrongTyping)
      Return the double value held by this argument
      Parameters:
      bStrongTyping - apply strong typing when set.
      Returns:
      our double value
    • getException

      public ExFull getException()
      Return the exception held by this argument.
      Returns:
      the current exception
    • getInteger

      public Integer getInteger()
      Return the integer held by this argument
      Returns:
      our integer value.
    • getObject

      public Obj getObject()
      Return the object held by this argument.
      Returns:
      the current Obj
    • getString

      public String getString()
      Return the string value held by this argument
      Returns:
      our string value
    • getVoid

      public Object getVoid(boolean bThrowException)
      Return the data object held by this argument.
      Returns:
      the data object.
      Throws:
      ExFull - ArgumentMismatchException - if the current type is not EXCEPTION
    • isCompatibleWith

      public boolean isCompatibleWith(int eType)
      Return the this Arg is compatible with a given type
      Parameters:
      eType - the argument type use in the comparison
      Returns:
      true if compatible else false
    • isEmpty

      public boolean isEmpty()
      Find out if this argument is empty
      Returns:
      TRUE if the argument is empty, FALSE otherwise
    • setBool

      public void setBool(Boolean b)
      Assign this argument to a boolean
      Parameters:
      b - the boolean value to take on
    • setDouble

      public void setDouble(Double d)
      Assign this argument to a double
      Parameters:
      d - the double value to take on
    • setException

      public void setException(ExFull ex)
      Assign this argument to an exception (representing an error)
      Parameters:
      ex - The exception to hold.
    • setInteger

      public void setInteger(Integer i)
      Assign this argument to an integer
      Parameters:
      i - the integer value to take on
    • setNull

      public void setNull()
      Set this argument to be NULL
    • setObject

      public void setObject(Obj obj)
      Assign this argument to a given XFA object
      Parameters:
      obj - The XFA object to hold.
    • setObject

      public void setObject(Obj obj, boolean bIsRef)
      Assign this argument to a given XFA object
      Parameters:
      obj - The XFA object to hold.
      bIsRef - Set to true if the object is a reference/pointer to another Object.
    • setObject

      public void setObject(Obj obj, boolean bIsRef, boolean bIsProp)
      Assign this argument to a given XFA object
      Parameters:
      obj - The XFA object to hold.
      bIsRef - Set to true if the object is a reference/pointer to another Object.
    • setString

      public void setString(String s)
      Assign this argument to a string
      Parameters:
      s - the string value to take on
    • setVoid

      public void setVoid(Object oData)
      Assign this argument to a data object..
      Parameters:
      oData - the object.
    • isRefObject

      public boolean isRefObject()
      Is the current Object a reference/pointer to another Object.
      Returns:
      True if the current object is a reference/pointer to another Object, otherwise FALSE.
    • isXFAProperty

      public boolean isXFAProperty()
      Is the current Object resolved through property.
      Returns:
      True if the current object is resolved through property, otherwise FALSE.