|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.ParameterListDescriptorImpl
A concrete implementation of the ParameterListDescriptor
interface.
ParameterListDescriptor
, Serialized FormFields inherited from interface javax.media.jai.ParameterListDescriptor |
NO_PARAMETER_DEFAULT |
Constructor Summary | |
ParameterListDescriptorImpl()
Constructor for descriptors that dont have any parameters. |
|
ParameterListDescriptorImpl(Object descriptor,
String[] paramNames,
Class[] paramClasses,
Object[] paramDefaults,
Object[] validParamValues)
Constructor. |
Method Summary | |
String[] |
getEnumeratedParameterNames()
Return an array of the names of all parameters the type of which is EnumeratedParameter . |
EnumeratedParameter[] |
getEnumeratedParameterValues(String parameterName)
Return an array of EnumeratedParameter objects
corresponding to the parameter with the specified name. |
static Set |
getEnumeratedValues(Object descriptor,
Class paramClass)
Uses reflection to examine "descriptor" for public ,
static final Field s
that are instances of "paramClass". |
int |
getNumParameters()
Returns the total number of parameters. |
Class[] |
getParamClasses()
Returns an array of Class es that describe the types
of parameters. |
Object[] |
getParamDefaults()
Returns an array of Object s that define the default
values of the parameters. |
Object |
getParamDefaultValue(String parameterName)
Returns the default value of a specified parameter. |
String[] |
getParamNames()
Returns an array of String s that are the
names of the parameters associated with this descriptor. |
Range |
getParamValueRange(String parameterName)
Returns the Range that represents the range of valid
values for the specified parameter. |
boolean |
isParameterValueValid(String parameterName,
Object value)
Checks to see if the specified parameter can take on the specified value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ParameterListDescriptorImpl()
public ParameterListDescriptorImpl(Object descriptor, String[] paramNames, Class[] paramClasses, Object[] paramDefaults, Object[] validParamValues)
descriptor
- the object to be reflected upon for enumerated valuesparamNames
- the names of each parameter. can be null
if there are no parameters.paramClasses
- the Class
type of each parameter.
can be null
if there are no parameters.paramDefaults
- the default values for each parameter. can be
null
if there are no parameters or if
there are no default values, in which case the parameter
defaults are assumed to be
ParameterListDescriptor.NO_PARAMETER_DEFAULT
validParamValues
- defines the valid values for each parameter.
Each element of this array can be null
(if the parameter
can take on any value of its class or if it is an enumerated parameter
whose values are to be auto-detected - see getEnumeratedValues
), or a Set
(for user specified enumerated
values) or a Range
(for parameters that are
Comparable
.)
The valid set of values for an object which is neither an
EnumeratedParameter
nor Comparable
should just be the set of all possible instances of the associated
class, i.e., the parameter has to be an instance of the specified
class.
If this array itself is null
then it is treated
as an array full of null
s as described above.
IllegalArgumentException
- if paramNames
is non-null
and the number of paramClasses
or a non-null
paramDefaults
does not match the length of
paramNames
IllegalArgumentException
- if null
is passed in for
validParamValues
for a parameter whose
class is of EnumeratedParameter
type.Method Detail |
public static Set getEnumeratedValues(Object descriptor, Class paramClass)
public
,
static
final
Field
s
that are instances of "paramClass".descriptor
- the object to be reflected upon.paramClass
- the parameter classSet
of enumerated values.IllegalArgumentException
- if descriptor is null
or paramClass is null
IllegalArgumentException
- if "paramClass" is not an instance of
EnumeratedParameter
public int getNumParameters()
getNumParameters
in interface ParameterListDescriptor
public Class[] getParamClasses()
Class
es that describe the types
of parameters. If there are no parameters, this method returns
null
.getParamClasses
in interface ParameterListDescriptor
public String[] getParamNames()
String
s that are the
names of the parameters associated with this descriptor. If there
are no parameters, this method returns null
.getParamNames
in interface ParameterListDescriptor
public Object[] getParamDefaults()
Object
s that define the default
values of the parameters. Default values may be null
.
The NO_PARAMETER_DEFAULT
static Object
indicates that a parameter has no default value. If there are no
parameters, this method returns null
.getParamDefaults
in interface ParameterListDescriptor
public Object getParamDefaultValue(String parameterName)
null
. If a parameter has no default
value, this method returns NO_PARAMETER_DEFAULT
.getParamDefaultValue
in interface ParameterListDescriptor
parameterName
- The name of the parameter whose default
value is queried.IllegalArgumentException
- if parameterName
is null
or if the parameter does not exist.public Range getParamValueRange(String parameterName)
Range
that represents the range of valid
values for the specified parameter. Returns null
if
the parameter can take on any value or if the valid values are
not representable as a Range.getParamValueRange
in interface ParameterListDescriptor
parameterName
- The name of the parameter whose valid range
of values is to be determined.IllegalArgumentException
- if parameterName
is null
or if the parameter does not exist.public String[] getEnumeratedParameterNames()
EnumeratedParameter
.getEnumeratedParameterNames
in interface ParameterListDescriptor
null
if there
are no parameters with EnumeratedParameter
type.public EnumeratedParameter[] getEnumeratedParameterValues(String parameterName)
EnumeratedParameter
objects
corresponding to the parameter with the specified name.getEnumeratedParameterValues
in interface ParameterListDescriptor
parameterName
- The name of the parameter for which the
EnumeratedParameter
array is to be returned.EnumeratedParameter
objects
representing the range of values for the named parameter.IllegalArgumentException
- if parameterName
is null
or if the parameter does not exist.UnsupportedOperationException
- if there are no enumerated
parameters associated with the descriptor.IllegalArgumentException
- if parameterName
is
a parameter the class of which is not a subclass of
EnumeratedParameter
.public boolean isParameterValueValid(String parameterName, Object value)
isParameterValueValid
in interface ParameterListDescriptor
parameterName
- The name of the parameter for which the
validity check is to be performed.IllegalArgumentException
- if parameterName
is null
or if the parameter does not exist.IllegalArgumentException
- if the class of the object "value"
is not an instance of the class type of parameter
pointed to by the parameterName
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |