org.ujoframework.orm
Class AbstractMetaModel

java.lang.Object
  extended by org.ujoframework.extensions.AbstractUjo
      extended by org.ujoframework.implementation.quick.QuickUjo
          extended by org.ujoframework.orm.AbstractMetaModel
All Implemented Interfaces:
java.io.Serializable, UjoCloneable, UjoTextable, Ujo
Direct Known Subclasses:
MetaDatabase, MetaIndex, MetaParams, MetaPKey, MetaProcedure, MetaRelation2Many, MetaRoot, MetaSelect, MetaTable

public abstract class AbstractMetaModel
extends QuickUjo

Abstract Metamodel

Author:
Pavel Ponec
See Also:
Serialized Form

Constructor Summary
AbstractMetaModel()
           
 
Method Summary
<UJO extends AbstractMetaModel,VALUE>
VALUE
get(UjoProperty<UJO,VALUE> property)
          Getter based on one UjoProperty
protected
<UJO extends Ujo,VALUE>
void
changeDefault(UJO ujo, UjoProperty<UJO,VALUE> property, VALUE value)
          Assign a 'valid value' over a default UJO property value only
 boolean checkReadOnly(boolean exception)
          Test a read-only state
protected  boolean isUsable(java.lang.CharSequence text)
          Returns true, if the argument text is not null and not empty.
protected  boolean isUsable(java.lang.Object value)
          Returns true, if the argument text is not null and not empty.
 boolean readAuthorization(UjoAction action, UjoProperty property, java.lang.Object value)
          Get an authorization of the property for different actions.
 boolean readOnly()
          Property values can be readed only
 void setReadOnly(boolean recurse)
          Set a read-only state.
 void writeValue(UjoProperty property, java.lang.Object value)
          It is a common method for writing all object values, however there is strongly recomended to use a method Property.setValue(org.ujoframework.Ujo, java.lang.Object) to an external access for a better type safe.
 
Methods inherited from class org.ujoframework.implementation.quick.QuickUjo
newListProperty, newListProperty, newProperty, newProperty, newProperty, newProperty, newProperty, newProperty, readValue
 
Methods inherited from class org.ujoframework.extensions.AbstractUjo
clone, equals, init, init, readProperties, readUjoManager, readValueString, toString, writeValueString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMetaModel

public AbstractMetaModel()
Method Detail

readOnly

public boolean readOnly()
Property values can be readed only


setReadOnly

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


checkReadOnly

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

Throws:
java.lang.UnsupportedOperationException

writeValue

public void writeValue(UjoProperty property,
                       java.lang.Object value)
Description copied from class: QuickUjo
It is a common method for writing all object values, however there is strongly recomended to use a method Property.setValue(org.ujoframework.Ujo, java.lang.Object) to an external access for a better type safe. The method have got a strategy place for an implementation of several listeners and validators.
NOTE: If property is an incorrect then method can throws an ArrayIndexOutOfBoundsException.

Specified by:
writeValue in interface Ujo
Overrides:
writeValue in class QuickUjo
Parameters:
property - Property must be a direct type only!
See Also:
Property.setValue(Ujo,Object)

changeDefault

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


readAuthorization

public boolean readAuthorization(UjoAction action,
                                 UjoProperty property,
                                 java.lang.Object value)
Description copied from class: AbstractUjo
Get an authorization of the property for different actions.
A Default value is TRUE for all actions, properties and values.

Specified by:
readAuthorization in interface Ujo
Overrides:
readAuthorization in class AbstractUjo
Parameters:
action - Type of request. See constant(s) ACTION_* for more information. The action must not be null, however there is allowed to use a dummy constant UjoAction.DUMMY .
property - A property of the Ujo
value - A value
Returns:
Returns TRUE, if property is authorized.
See Also:
Action Constants

isUsable

protected boolean isUsable(java.lang.CharSequence text)
Returns true, if the argument text is not null and not empty.


isUsable

protected boolean isUsable(java.lang.Object value)
Returns true, if the argument text is not null and not empty.


get

public <UJO extends AbstractMetaModel,VALUE> VALUE get(UjoProperty<UJO,VALUE> property)
Getter based on one UjoProperty



Copyright © 2010. All Rights Reserved.