org.apache.commons.attributes

Class DefaultSealable

Implemented Interfaces:
Sealable

public class DefaultSealable
extends java.lang.Object
implements Sealable

Implementation of the Sealable interface. Subclasses should call checkSealed() before setting any bean properties.
Since:
2.1

Field Summary

private boolean
sealed
Boolean flag indicating whether the seal() method has been called.

Constructor Summary

DefaultSealable()
Default ctor.

Method Summary

protected void
checkSealed()
Checks if the seal() method has been called and throws a IllegalStateException if it has.
void
seal()
Seals this attribute.

Field Details

sealed

private boolean sealed
Boolean flag indicating whether the seal() method has been called.

Constructor Details

DefaultSealable

public DefaultSealable()
Default ctor.

Method Details

checkSealed

protected void checkSealed()
            throws IllegalStateException
Checks if the seal() method has been called and throws a IllegalStateException if it has.
Since:
2.1

seal

public void seal()
Seals this attribute. Any future calls to the checkSealed() method will result in an IllegalStateException being thrown.
Specified by:
seal in interface Sealable
Since:
2.1