Constrained Property Access Methods

The design pattern for setting and getting constrained properties is similar to those of properties that are not constrained. The difference is that the set() method declares that it throws the exception java.beans.PropertyVetoException. The method signatures are:

public <PropertyType> get<PropertyName>();
public void set<PropertyName>(<PropertyType> value)
                   throws java.beans.PropertyVetoException;

Get Developing Java Beans now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.