org.ujoframework.implementation.quick
Class QuickUjoMid<UJO_IMPL extends QuickUjoMid>

java.lang.Object
  extended by org.ujoframework.extensions.AbstractUjo
      extended by org.ujoframework.implementation.quick.QuickUjo
          extended by org.ujoframework.implementation.quick.QuickUjoMid<UJO_IMPL>
All Implemented Interfaces:
java.io.Serializable, UjoCloneable, UjoMiddle<UJO_IMPL>, UjoTextable, Ujo
Direct Known Subclasses:
DbProcedure

public abstract class QuickUjoMid<UJO_IMPL extends QuickUjoMid>
extends QuickUjo
implements UjoMiddle<UJO_IMPL>

This is a fast implementation of the UjoMiddle. For implementation define only a "public static final UjoProperty" constants call a static method init() from the static block located after the latest property.
All properties must be objects (no primitive types) in the current version of UJO Framework.
Features: good performance, simple code.

Sample of usage

 import org.ujoframework.implementation.quick.*;
 public class Person extends QuickUjo {

    public static final UjoProperty<Person,String > NAME  = newProperty(String.class);
    public static final UjoProperty<Person,Boolean> MALE  = newProperty(Boolean.class);
    public static final UjoProperty<Person,Date   > BIRTH = newProperty(Date.class);

    static {
        init(Person.class);
    }
 }

Author:
Pavel Ponec
See Also:
UjoMiddle, Serialized Form

Constructor Summary
QuickUjoMid()
          No parameters constuctor
QuickUjoMid(java.lang.Object[] aData)
          Constructor
 
Method Summary
<UJO extends UJO_IMPL,VALUE>
VALUE
get(UjoProperty<UJO,VALUE> property)
          Getter based on one UjoProperty
 java.lang.String getText(UjoProperty property)
          Returns a String value by a NULL context.
<UJO extends UJO_IMPL,VALUE>
Ujo
set(UjoProperty<UJO,VALUE> property, VALUE value)
          Setter based on UjoProperty.
 void setText(UjoProperty property, java.lang.String value)
          Set value from a String format by a NULL context.
 
Methods inherited from class org.ujoframework.implementation.quick.QuickUjo
newListProperty, newListProperty, newProperty, newProperty, newProperty, newProperty, newProperty, newProperty, readValue, writeValue
 
Methods inherited from class org.ujoframework.extensions.AbstractUjo
clone, equals, init, init, readAuthorization, readProperties, 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.ujoframework.Ujo
readAuthorization, readProperties, readValue, writeValue
 

Constructor Detail

QuickUjoMid

public QuickUjoMid(java.lang.Object[] aData)
Constructor


QuickUjoMid

public QuickUjoMid()
No parameters constuctor

Method Detail

get

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

Specified by:
get in interface UjoMiddle<UJO_IMPL extends QuickUjoMid>

set

public <UJO extends UJO_IMPL,VALUE> Ujo set(UjoProperty<UJO,VALUE> property,
                                            VALUE value)
Setter based on UjoProperty. Type of value is checked in the runtime.

Specified by:
set in interface UjoMiddle<UJO_IMPL extends QuickUjoMid>

getText

public java.lang.String getText(UjoProperty property)
Returns a String value by a NULL context. otherwise method returns an instance of String.

Specified by:
getText in interface UjoMiddle<UJO_IMPL extends QuickUjoMid>
Parameters:
property - A Property
Returns:
If property type is "container" then result is null.

setText

public void setText(UjoProperty property,
                    java.lang.String value)
Set value from a String format by a NULL context. Types Ujo, List, Object[] are not supported by default.
The method is an alias for a method writeValueString(...)

Specified by:
setText in interface UjoMiddle<UJO_IMPL extends QuickUjoMid>
Parameters:
property - Property
value - String value


Copyright © 2010. All Rights Reserved.