ValidateAttribute Interface

com.bea.control
ValidateAttribute Interface

public interface ValidateAttribute

The ValidateAttribute interface provides methods with which you can validate a property tag attribute. This will be used by the WebLogic Workshop compiler to show errors in source for an attribute of custom type, and by the IDE property view for any attribute. To expose your implementation to the IDE, you specify the implementation with the class-name attribute of the <custom> element in the control's tags XML file. To use it in the property view, an instance of this class should be returned when appropriate by the EditorSupport.getBehavior() call for your control.

Note: The ValidateAttribute interface is part of the WebLogic Workshop Control Development Kit. The Control Development Kit is for users who are creating advanced controls. It is available in your BEA installation in the following directory: BEA_HOME\weblogic81\samples\workshop\ControlDevKit\

Method Summary

public Issue[]
validateDuringCompile(String attributeType, String value, Map context)
Provides a way for property attributes to be validated during compilation, and for you to display specific information in Source View for invalid attribute values.
public Issue[]
validateDuringEdit(String attributeType, String value)
Provides a way for property attributes to be validated while they are being edited.

Method Detail

validateDuringCompile(String, String, Map) Method

public Issue[] validateDuringCompile(String attributeType, 
                                   String value, 
                                   Map context)
Provides a way for property attributes to be validated during compilation, and for you to display specific information in Source View for invalid attribute values. This method is called by the IDE under many circumstances, including attempts by the control's user to build a component that contains the control. Invalid attributes will be displayed in Source View with a red underline.

Parameters

attributeType
The name of the attribute being validated.
value
The attribute's current value.
context
State that the control author can use to accumulate information during

Returns

An array of issues. If there are no issues the array should be empty.

validateDuringEdit(String, String) Method

public Issue[] validateDuringEdit(String attributeType, 
                                String value)
Provides a way for property attributes to be validated while they are being edited. In particular, this method is called by the IDE when the control's user edits the specified attribute's value and attempts to save the value by navigating past the value in the Property Editor. You can also call this method from your own custom property editing dialog.

Parameters

attributeType
The name of the attribute being validated.
value
The attribute's current value.

Returns

An array of issues. If there are no issues the array should be empty.