org.ujorm.orm
Class AbstractMetaModel

java.lang.Object
  extended by org.ujorm.extensions.SuperAbstractUjo
      extended by org.ujorm.extensions.AbstractUjo
          extended by org.ujorm.orm.AbstractMetaModel
All Implemented Interfaces:
Serializable, UjoCloneable, UjoLockable, UjoTextable, Ujo
Direct Known Subclasses:
MetaDatabase, MetaIndex, MetaParams, MetaPKey, MetaProcedure, MetaRelation2Many, MetaRoot, MetaSelect, MetaTable, MoreParams

public abstract class AbstractMetaModel
extends AbstractUjo
implements UjoLockable

Abstract Metamodel

See Also:
Serialized Form

Constructor Summary
AbstractMetaModel()
           
 
Method Summary
protected
<UJO extends Ujo,VALUE>
void
changeDefault(UJO ujo, Key<UJO,VALUE> key, VALUE value)
          Assign a 'valid value' over a default UJO key value only
 boolean checkReadOnly(boolean exception)
          Test a read-only state
protected  void clearReadOnly(OrmHandler handler)
          Unlock the meta-model.
<UJO extends AbstractMetaModel,VALUE>
VALUE
get(Key<UJO,VALUE> key)
          Getter based on one Key
 void lock()
          Lock the class and all other relations
 boolean readAuthorization(UjoAction action, Key key, Object value)
           
 boolean readOnly()
          Property values are locked to read-only.
 void setReadOnly(boolean recurse)
          Set a read-only state.
 void writeValue(Key<?,?> key, Object value)
          Write a value if the operation is enabled
 
Methods inherited from class org.ujorm.extensions.AbstractUjo
newCamelFactory, newFactory, readValue
 
Methods inherited from class org.ujorm.extensions.SuperAbstractUjo
clone, equals, init, init, readKeys, readUjoManager, readValueString, toString, writeValueString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ujorm.Ujo
readKeys, readValue
 

Constructor Detail

AbstractMetaModel

public AbstractMetaModel()
Method Detail

readOnly

public boolean readOnly()
Property values are locked to read-only.

Specified by:
readOnly in interface UjoLockable

clearReadOnly

protected void clearReadOnly(OrmHandler handler)
Unlock the meta-model. the method is for internal use only. The method must be enabled by parameter: MoreParams.ENABLE_TO_UNLOCK_IMMUTABLE_METAMODEL.


lock

public void lock()
Lock the class and all other relations

Specified by:
lock in interface UjoLockable

setReadOnly

public void setReadOnly(boolean recurse)
Set a read-only state.


checkReadOnly

public boolean checkReadOnly(boolean exception)
                      throws UnsupportedOperationException
Test a read-only state

Throws:
UnsupportedOperationException

writeValue

public void writeValue(Key<?,?> key,
                       Object value)
                throws UnsupportedOperationException
Write a value if the operation is enabled

Specified by:
writeValue in interface UjoLockable
Specified by:
writeValue in interface Ujo
Overrides:
writeValue in class AbstractUjo
Throws:
UnsupportedOperationException

changeDefault

protected <UJO extends Ujo,VALUE> void changeDefault(UJO ujo,
                                                     Key<UJO,VALUE> key,
                                                     VALUE value)
Assign a 'valid value' over a default UJO key value only


readAuthorization

public boolean readAuthorization(UjoAction action,
                                 Key key,
                                 Object value)
Specified by:
readAuthorization in interface Ujo
Overrides:
readAuthorization in class SuperAbstractUjo

get

public <UJO extends AbstractMetaModel,VALUE> VALUE get(Key<UJO,VALUE> key)
Getter based on one Key



Copyright 2013, Pavel Ponec