Top Description Inners Constructors Methods
com.sun.jna

pack-priv abstract Class VarArgsChecker

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.jna.VarArgsChecker.RealVarArgsChecker, com.sun.jna.VarArgsChecker.NoVarArgsChecker
Imports
java.lang.reflect.Method

Class for checking if a method has vararg parameters. Use method create() to create an instance of this class. How the returned instance work depends on the capabilities of the underlying JVM implementation. On older versions of the VM not supporting varargs, the returned VarArgsChecker will always return false on calls to isVarArgs(Method).
Author
Max Bureck

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
VarArgsChecker.NoVarArgsChecker

Implementation always returning false when NoVarArgsChecker#isVarArgs(Method) is called.

private static class
VarArgsChecker.RealVarArgsChecker

Implementation actually using Method.isVarArgs()

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static VarArgsChecker

Returns:

new instance of concrete VarArgsChecker subclass
create
()

Creates a new instance of a concrete subclass of VarArgsChecker, depending if Method#isVarArgs() exists.

pack-priv abstract int

Returns:

Number of fixed arguments if the given method takes a variable number of arguments, zero otherwise.
fixedArgs
(Method
Method to be checked
m
)

If variadic, returns the number of fixed arguments to the method.

pack-priv abstract boolean

Returns:

true if the given method takes a variable number of arguments, false otherwise.
isVarArgs
(Method
Method to be checked
m
)

Checks if the given method was declared to take a variable number of arguments.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

VarArgsCheckerback to summary
private VarArgsChecker()

Method Detail

createback to summary
pack-priv static VarArgsChecker create()

Creates a new instance of a concrete subclass of VarArgsChecker, depending if Method#isVarArgs() exists.

Returns:VarArgsChecker

new instance of concrete VarArgsChecker subclass

fixedArgsback to summary
pack-priv abstract int fixedArgs(Method m)

If variadic, returns the number of fixed arguments to the method.

Parameters
m:Method

Method to be checked

Returns:int

Number of fixed arguments if the given method takes a variable number of arguments, zero otherwise.

isVarArgsback to summary
pack-priv abstract boolean isVarArgs(Method m)

Checks if the given method was declared to take a variable number of arguments.

Parameters
m:Method

Method to be checked

Returns:boolean

true if the given method takes a variable number of arguments, false otherwise.

com.sun.jna back to summary

private final Class VarArgsChecker.NoVarArgsChecker

extends VarArgsChecker
Class Inheritance

Implementation always returning false when NoVarArgsChecker#isVarArgs(Method) is called. This implementation will be chosen, if Method#isVarArgs() is not available

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv int
fixedArgs(Method
Method to be checked
m
)

Implements abstract com.sun.jna.VarArgsChecker.fixedArgs.

If variadic, returns the number of fixed arguments to the method.
pack-priv boolean
isVarArgs(Method
Method to be checked
m
)

Implements abstract com.sun.jna.VarArgsChecker.isVarArgs.

Checks if the given method was declared to take a variable number of arguments.
Inherited from com.sun.jna.VarArgsChecker:
create

Constructor Detail

NoVarArgsCheckerback to summary
private NoVarArgsChecker()

Method Detail

fixedArgsback to summary
pack-priv int fixedArgs(Method m)

Implements abstract com.sun.jna.VarArgsChecker.fixedArgs.

Doc from com.sun.jna.VarArgsChecker.fixedArgs.

If variadic, returns the number of fixed arguments to the method.

Parameters
m:Method

Method to be checked

Returns:int

Number of fixed arguments if the given method takes a variable number of arguments, zero otherwise.

isVarArgsback to summary
pack-priv boolean isVarArgs(Method m)

Implements abstract com.sun.jna.VarArgsChecker.isVarArgs.

Doc from com.sun.jna.VarArgsChecker.isVarArgs.

Checks if the given method was declared to take a variable number of arguments.

Parameters
m:Method

Method to be checked

Returns:boolean

true if the given method takes a variable number of arguments, false otherwise.

com.sun.jna back to summary

private final Class VarArgsChecker.RealVarArgsChecker

extends VarArgsChecker
Class Inheritance

Implementation actually using Method.isVarArgs()

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv int
fixedArgs(Method
Method to be checked
m
)

Implements abstract com.sun.jna.VarArgsChecker.fixedArgs.

If variadic, returns the number of fixed arguments to the method.
pack-priv boolean
isVarArgs(Method
Method to be checked
m
)

Implements abstract com.sun.jna.VarArgsChecker.isVarArgs.

Checks if the given method was declared to take a variable number of arguments.
Inherited from com.sun.jna.VarArgsChecker:
create

Constructor Detail

RealVarArgsCheckerback to summary
private RealVarArgsChecker()

Method Detail

fixedArgsback to summary
pack-priv int fixedArgs(Method m)

Implements abstract com.sun.jna.VarArgsChecker.fixedArgs.

Doc from com.sun.jna.VarArgsChecker.fixedArgs.

If variadic, returns the number of fixed arguments to the method.

Parameters
m:Method

Method to be checked

Returns:int

Number of fixed arguments if the given method takes a variable number of arguments, zero otherwise.

isVarArgsback to summary
pack-priv boolean isVarArgs(Method m)

Implements abstract com.sun.jna.VarArgsChecker.isVarArgs.

Doc from com.sun.jna.VarArgsChecker.isVarArgs.

Checks if the given method was declared to take a variable number of arguments.

Parameters
m:Method

Method to be checked

Returns:boolean

true if the given method takes a variable number of arguments, false otherwise.