org.apache.commons.attributes
Class DefaultSealable

java.lang.Object
  extended byorg.apache.commons.attributes.DefaultSealable
All Implemented Interfaces:
Sealable

public class DefaultSealable
extends Object
implements Sealable

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

Since:
2.1

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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSealable

public DefaultSealable()
Default ctor.

Method Detail

checkSealed

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

Throws:
IllegalStateException - if this attribute has been sealed.
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


Copyright © The Apache Software Foundation. All Rights Reserved.