org.ujoframework.extensions
Interface UjoExt<UJO_IMPL extends UjoExt>

All Superinterfaces:
Ujo, UjoMiddle<UJO_IMPL>
All Known Implementing Classes:
AbstractUjoExt, ArrayUjoExt, BeanUjoExt, FieldUjoExt, MapUjoExt, RegistrarUjoExt, UjoPropertyRow

public interface UjoExt<UJO_IMPL extends UjoExt>
extends UjoMiddle<UJO_IMPL>

This is an extended Ujo interface designed for a more conventional property access evaluated by developers. Most of the functions have been a similar reason like methods in the UjoProperty class. The new solution allows to the developers to chain more properties according to a model of a some new popular languages. All methods are type safe likewise the usage of the Ujo interface - exclude two methods with an unlimited count of properties: setVal(...) and getVal(...).
Sample of usage:

public class Person extends MapUjo implements UjoMiddle {

  public static final UjoProperty<Person, String > NAME = newProperty("Name", String.class);
  public static final UjoProperty<Person, Double > CASH = newProperty("Cash", Double.class);
  public static final UjoProperty<Person, Person> CHILD = newProperty("Child", Person.class);
    
  public void init() {
    set(NAME, "George");
    set(CHILD, new Person());
    set(CHILD, NAME, "Jane");
    set(CHILD, CASH, 200d);
        
    String name = get(CHILD, NAME);
    double cash = get(CHILD, CASH);
  }
}

Since:
UJO release 0.80
Author:
Pavel Ponec

Method Summary
<UJO extends UJO_IMPL,ITEM>
Ujo
add(ListUjoProperty<UJO,ITEM> property, ITEM value)
          Add Value, if the List is null then the list will be created.
<UJO extends UJO_IMPL,ITEM>
ITEM
get(ListUjoProperty<UJO,ITEM> property, int index)
          Get Value
Inside is called a method ListUjoPropertyCommon.getItem(...) .
<UJO1 extends UJO_IMPL,UJO2 extends Ujo,UJO3 extends Ujo,VALUE>
VALUE
get(UjoProperty<UJO1,UJO2> property1, UjoProperty<UJO2,UJO3> property2, UjoProperty<UJO3,VALUE> property3)
          Getter based on three properties
<UJO1 extends UJO_IMPL,UJO2 extends Ujo,VALUE>
VALUE
get(UjoProperty<UJO1,UJO2> property1, UjoProperty<UJO2,VALUE> property2)
          Getter based on two properties
<UJO extends UJO_IMPL,ITEM>
int
getItemCount(ListUjoProperty<UJO,ITEM> property)
          Returns a count of Items.
<UJO extends UJO_IMPL,VALUE>
boolean
isDefault(UjoProperty<UJO,VALUE> property)
          Indicates whether a parameter value "equal to" property default value.
<UJO extends UJO_IMPL,LIST extends java.util.List<ITEM>,ITEM>
LIST
list(ListUjoProperty<UJO,ITEM> property)
          Returns a not null List.
<UJO extends UJO_IMPL,ITEM>
ITEM
remove(ListUjoProperty<UJO,ITEM> property, int index)
          Get Value
<UJO extends UJO_IMPL,ITEM>
Ujo
set(ListUjoProperty<UJO,ITEM> property, int index, ITEM value)
          Add Value, if the List is null then the list will be created.
<UJO1 extends UJO_IMPL,UJO2 extends Ujo,UJO3 extends Ujo,VALUE>
void
set(UjoProperty<UJO1,UJO2> property1, UjoProperty<UJO2,UJO3> property2, UjoProperty<UJO3,VALUE> property3, VALUE value)
          Setter based on three properties.
<UJO1 extends UJO_IMPL,UJO2 extends Ujo,VALUE>
void
set(UjoProperty<UJO1,UJO2> property1, UjoProperty<UJO2,VALUE> property2, VALUE value)
          Setter based on two properties.
 
Methods inherited from interface org.ujoframework.extensions.UjoMiddle
get, getText, set, setText
 
Methods inherited from interface org.ujoframework.Ujo
readAuthorization, readProperties, readValue, writeValue
 

Method Detail

get

<UJO1 extends UJO_IMPL,UJO2 extends Ujo,VALUE> VALUE get(UjoProperty<UJO1,UJO2> property1,
                                                         UjoProperty<UJO2,VALUE> property2)
Getter based on two properties


get

<UJO1 extends UJO_IMPL,UJO2 extends Ujo,UJO3 extends Ujo,VALUE> VALUE get(UjoProperty<UJO1,UJO2> property1,
                                                                          UjoProperty<UJO2,UJO3> property2,
                                                                          UjoProperty<UJO3,VALUE> property3)
Getter based on three properties


set

<UJO1 extends UJO_IMPL,UJO2 extends Ujo,VALUE> void set(UjoProperty<UJO1,UJO2> property1,
                                                        UjoProperty<UJO2,VALUE> property2,
                                                        VALUE value)
Setter based on two properties. Type of value is checked in the runtime.


set

<UJO1 extends UJO_IMPL,UJO2 extends Ujo,UJO3 extends Ujo,VALUE> void set(UjoProperty<UJO1,UJO2> property1,
                                                                         UjoProperty<UJO2,UJO3> property2,
                                                                         UjoProperty<UJO3,VALUE> property3,
                                                                         VALUE value)
Setter based on three properties. Type of value is checked in the runtime.


getItemCount

<UJO extends UJO_IMPL,ITEM> int getItemCount(ListUjoProperty<UJO,ITEM> property)
Returns a count of Items. If the property is null, method returns 0.
Inside is called a method ListUjoPropertyCommon.getItemCount() .


add

<UJO extends UJO_IMPL,ITEM> Ujo add(ListUjoProperty<UJO,ITEM> property,
                                    ITEM value)
Add Value, if the List is null then the list will be created.
Inside is called a method ListUjoPropertyCommon.addItem(...) .


set

<UJO extends UJO_IMPL,ITEM> Ujo set(ListUjoProperty<UJO,ITEM> property,
                                    int index,
                                    ITEM value)
Add Value, if the List is null then the list will be created.
Inside is called a method ListUjoPropertyCommon.setItem(...) .


get

<UJO extends UJO_IMPL,ITEM> ITEM get(ListUjoProperty<UJO,ITEM> property,
                                     int index)
Get Value
Inside is called a method ListUjoPropertyCommon.getItem(...) .


remove

<UJO extends UJO_IMPL,ITEM> ITEM remove(ListUjoProperty<UJO,ITEM> property,
                                        int index)
Get Value


list

<UJO extends UJO_IMPL,LIST extends java.util.List<ITEM>,ITEM> LIST list(ListUjoProperty<UJO,ITEM> property)
Returns a not null List. If original list value is empty, the new List is created.
Inside is called a method ListUjoPropertyCommon.getList() .


isDefault

<UJO extends UJO_IMPL,VALUE> boolean isDefault(UjoProperty<UJO,VALUE> property)
Indicates whether a parameter value "equal to" property default value.



Copyright © 2010. All Rights Reserved.