A convenience subclass of
ParameterBlock that allows the use of default parameter values and getting/setting sources and parameters by name. A
ParameterBlockJAI is constructed using either an
OperationDescriptor, or an operation name (that will be looked up in the appropriate default
OperationRegistry) and a mode which should be in
OperationDescriptor.getSupportedModes() (such as rendered, renderable, collection or renderableCollection). If the mode is not specified
ParameterBlockJAI will by default work with the first mode in the array of
Strings returned by
OperationDescriptor.getSupportedModes().
Once constructed, a ParameterBlockJAI appears to have no sources. It contains all the parameters required by its OperationDescriptor for a specified mode, each having its default value as given by the OperationDescriptor. Such a ParameterBlockJAI may not yet be usable, its sources (if any) are not set, and some or all of its parameters may have inapproriate values. The addSource methods of ParameterBlock may be used to initialize the source values, and the set(value, index) methods may be used to modify new parameter values. The preferred way of setting parameter values is the setParameter(name, value) described below. The add() methods should not be used since the parameter list is already long enough to hold all of the parameters required by the OperationDescriptor.
Additionally, ParameterBlockJAI offers setParameter(name, value) methods that take a parameter name; the index of the parameter is determined from the OperationDescriptor and the corresponding parameter is set. (users are strongly recommended to use this method instead of the equivalent set(value, index) or the deprecated set(value, name) methods). As in ParameterBlock, all parameters are stored internally as subclasses of Object and all get/set methods that take or return values of primitive types are simply convenience methods that transform values between the primitive types and their corresponding wrapper classes.
The OperationDescriptor that is used to initialize a ParameterBlockJAI at construction is not serializable and thus cannot be serialized using the default serialization mechanism. The operation name is serialized instead and included in the serialized ParameterBlockJAI stream. During de-serialization, the operation name is de-serialized and then looked up in the default OperationRegistry available at the time of de-serialization. If no OperationDescriptor has been registered with this OperationRegistry under the given operation name, a NotSerializableException will be thrown. The serialization of ParameterBlockJAI works correctly only if the OperationDescriptor registered for the operation name in question is identical to the OperationDescriptor that was registered with the OperationRegistry available at serialization time.
All parameter names are treated in a case-insensitive but retentive manner.
Warning: Serialized objects of this class will not be compatible with future releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of JAI. A future release of JAI will provide support for long term persistence.