1 8 package org.codehaus.dna.impl; 9 10 16 abstract class AbstractFreezable 17 implements Freezable 18 { 19 23 private boolean m_readOnly; 24 25 28 public void makeReadOnly() 29 { 30 m_readOnly = true; 31 } 32 33 40 protected final void checkWriteable() 41 { 42 if( m_readOnly ) 43 { 44 final String message = 45 "Resource (" + this + ") is read only and can not be modified"; 46 throw new IllegalStateException ( message ); 47 } 48 } 49 50 56 protected final boolean isReadOnly() 57 { 58 return m_readOnly; 59 } 60 } 61 | Popular Tags |