public final class Arg extends Object
Type | Property and Description |
---|---|
boolean |
isXFA
Gets the value of the property xFAProperty.
|
Modifier and Type | Field and Description |
---|---|
static int |
BOOL |
static int |
DOUBLE |
static int |
EMPTY |
static int |
EXCEPTION |
static int |
INTEGER |
static int |
INVALID |
static int |
NULL |
static int |
OBJECT |
static int |
STRING |
static int |
VOIDPTR |
Constructor and Description |
---|
Arg()
Instantiates an empty arg object.
|
Arg(Arg src)
Instantiates a copy of the given arg object.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(Arg src)
Assigns the given arg object to this arg.
|
void |
empty()
Set this argument to be empty
|
boolean |
equals(Object object)
Comparison operator -- equality
|
int |
getArgType()
Return the argument type
|
Boolean |
getAsBool(boolean bThrowException)
Get the value as a boolean.
|
String |
getAsString(boolean bThrowException)
Get the value in the form of a string.
|
Boolean |
getBool()
Return the boolean value held by this argument
|
Double |
getDouble(boolean bStrongTyping)
Return the double value held by this argument
|
ExFull |
getException()
Return the exception held by this argument.
|
Integer |
getInteger()
Return the integer held by this argument
|
Obj |
getObject()
Return the object held by this argument.
|
String |
getString()
Return the string value held by this argument
|
Object |
getVoid(boolean bThrowException)
Return the data object held by this argument.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isCompatibleWith(int eType)
Return the this Arg is compatible with a given type
|
boolean |
isEmpty()
Find out if this argument is empty
|
boolean |
isRefObject()
Is the current Object a reference/pointer to another Object.
|
boolean |
isXFAProperty()
Gets the value of the property xFAProperty.
|
void |
setBool(Boolean b)
Assign this argument to a boolean
|
void |
setDouble(Double d)
Assign this argument to a double
|
void |
setException(ExFull ex)
Assign this argument to an exception (representing an error)
|
void |
setInteger(Integer i)
Assign this argument to an integer
|
void |
setNull()
Set this argument to be NULL
|
void |
setObject(Obj obj)
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 |
setString(String s)
Assign this argument to a string
|
void |
setVoid(Object oData)
Assign this argument to a data object..
|
public static final int NULL
public static final int BOOL
public static final int DOUBLE
public static final int EMPTY
public static final int EXCEPTION
public static final int INTEGER
public static final int INVALID
public static final int OBJECT
public static final int STRING
public static final int VOIDPTR
public Arg()
public Arg(Arg src)
src
- The Arg to be copied.public void assign(Arg src)
public void empty()
public boolean equals(Object object)
public int hashCode()
public int getArgType()
public Boolean getAsBool(boolean bThrowException)
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 FALSEThe 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.bThrowException
- when type is EXCEPTION; if TRUE: throws an exception, if
FALSE: returns FALSEArg
as a booleanthe
- stored exception if bThrowException is TRUE and the
current value is an exceptionpublic String getAsString(boolean bThrowException)
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 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.bThrowException
- when type is EXCEPTION; if TRUE: throws an exception, if
FALSE: returns an error messageArg
in the form of a stringthe
- stored exception if bThrowException is TRUE and the
current value is an exceptionpublic Boolean getBool()
ArgumentMismatchException
- if the current type is not BOOLpublic Double getDouble(boolean bStrongTyping)
bStrongTyping
- apply strong typing when set.ArgumentMismatchException
- if the current type is not DOUBLE or INTEGER. If the
current type is INTEGER, the value is automatically
converted to a double.public ExFull getException()
ArgumentMismatchException
- if the current type is not EXCEPTIONpublic Integer getInteger()
ArgumentMismatchException
- if the current type is cannot be converted to an integer.
If the current type is INTEGER, the integer value is
returned. If the current type is DOUBLE and the double
value has no fractional part, then the double value is
returned as an integer. If the double value has a
fractional part, ArgumentMismatchException is thrown.public Obj getObject()
ArgumentMismatchException
- if the current type is not OBJECTpublic String getString()
ArgumentMismatchException
- if the current type is not STRINGpublic Object getVoid(boolean bThrowException)
ExFull
- ArgumentMismatchException - if the current type is not EXCEPTIONpublic boolean isCompatibleWith(int eType)
eType
- the argument type use in the comparisonpublic boolean isEmpty()
public void setBool(Boolean b)
b
- the boolean value to take onpublic void setDouble(Double d)
d
- the double value to take onpublic void setException(ExFull ex)
ex
- The exception to hold.public void setInteger(Integer i)
i
- the integer value to take onpublic void setNull()
public void setObject(Obj obj)
obj
- The XFA object to hold.public void setObject(Obj obj, boolean bIsRef)
obj
- The XFA object to hold.bIsRef
- Set to true if the object is a reference/pointer to another Object.public void setObject(Obj obj, boolean bIsRef, boolean bIsProp)
obj
- The XFA object to hold.bIsRef
- Set to true if the object is a reference/pointer to another Object.public void setString(String s)
s
- the string value to take onpublic void setVoid(Object oData)
oData
- the object.public boolean isRefObject()
public boolean isXFAProperty()
Copyright © 2010 - 2020 Adobe. All Rights Reserved