Package com.adobe.xfa
Class Arg
java.lang.Object
com.adobe.xfa.Arg
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAssigns the given arg object to this arg.voidempty()Set this argument to be emptybooleanComparison operator -- equalityintReturn the argument typegetAsBool(boolean bThrowException) Get the value as a boolean.getAsString(boolean bThrowException) Get the value in the form of a string.getBool()Return the boolean value held by this argumentgetDouble(boolean bStrongTyping) Return the double value held by this argumentReturn the exception held by this argument.Return the integer held by this argumentReturn the object held by this argument.Return the string value held by this argumentgetVoid(boolean bThrowException) Return the data object held by this argument.inthashCode()Returns a hash code value for the object.booleanisCompatibleWith(int eType) Return the this Arg is compatible with a given typebooleanisEmpty()Find out if this argument is emptybooleanIs the current Object a reference/pointer to another Object.booleanIs the current Object resolved through property.voidAssign this argument to a booleanvoidAssign this argument to a doublevoidsetException(ExFull ex) Assign this argument to an exception (representing an error)voidAssign this argument to an integervoidsetNull()Set this argument to be NULLvoidAssign this argument to a given XFA objectvoidAssign this argument to a given XFA objectvoidAssign this argument to a given XFA objectvoidAssign this argument to a stringvoidAssign this argument to a data object..
-
Field Details
-
NULL
public static final int NULL- See Also:
-
BOOL
public static final int BOOL- See Also:
-
DOUBLE
public static final int DOUBLE- See Also:
-
EMPTY
public static final int EMPTY- See Also:
-
EXCEPTION
public static final int EXCEPTION- See Also:
-
INTEGER
public static final int INTEGER- See Also:
-
INVALID
public static final int INVALID- See Also:
-
OBJECT
public static final int OBJECT- See Also:
-
STRING
public static final int STRING- See Also:
-
VOIDPTR
public static final int VOIDPTR- See Also:
-
-
Constructor Details
-
Arg
public Arg()Instantiates an empty arg object. -
Arg
Instantiates a copy of the given arg object.- Parameters:
src- The Arg to be copied.
-
-
Method Details
-
assign
Assigns the given arg object to this arg. This is the assignment operator. -
empty
public void empty()Set this argument to be empty -
equals
Comparison operator -- equality -
hashCode
public int hashCode()Returns a hash code value for the object. This method is unsupported. -
getArgType
public int getArgType()Return the argument type- Returns:
- our argument type as an XFAArgType
-
getAsBool
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 thisArg, 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 FALSEThe parameterbThrowExceptiononly affects the behaviour if the current value of thisArgis 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
Argas a boolean
-
getAsString
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 messageThe parameterbThrowExceptiononly affects the behaviour if the current value of thisArgis 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
Argin the form of a string
-
getBool
Return the boolean value held by this argument- Returns:
- Our boolean value
-
getDouble
Return the double value held by this argument- Parameters:
bStrongTyping- apply strong typing when set.- Returns:
- our double value
-
getException
Return the exception held by this argument.- Returns:
- the current exception
-
getInteger
Return the integer held by this argument- Returns:
- our integer value.
-
getObject
Return the object held by this argument.- Returns:
- the current Obj
-
getString
Return the string value held by this argument- Returns:
- our string value
-
getVoid
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
Assign this argument to a boolean- Parameters:
b- the boolean value to take on
-
setDouble
Assign this argument to a double- Parameters:
d- the double value to take on
-
setException
Assign this argument to an exception (representing an error)- Parameters:
ex- The exception to hold.
-
setInteger
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
Assign this argument to a given XFA object- Parameters:
obj- The XFA object to hold.
-
setObject
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
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
Assign this argument to a string- Parameters:
s- the string value to take on
-
setVoid
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.
-