org.ujoframework.implementation.mapImpl
Class MapImplUjoMiddle<UJO_IMPL extends MapImplUjoMiddle>

java.lang.Object
  extended by org.ujoframework.extensions.AbstractUjo
      extended by org.ujoframework.implementation.mapImpl.MapImplUjo
          extended by org.ujoframework.implementation.mapImpl.MapImplUjoMiddle<UJO_IMPL>
All Implemented Interfaces:
java.io.Serializable, java.util.Map<java.lang.CharSequence,java.lang.Object>, UjoCloneable, UjoMiddle<UJO_IMPL>, UjoTextable, Ujo

public abstract class MapImplUjoMiddle<UJO_IMPL extends MapImplUjoMiddle>
extends MapImplUjo
implements UjoMiddle<UJO_IMPL>, java.io.Serializable

This is an middle extended implementation of a setter and getter methods for an easier access for developpers.
Notes:


Sample of usage:
public class Person extends MapImplUjoMiddle<Person> {

  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");
    String name = get(NAME);
  }
}

Since:
UJO release 0.85
Author:
Pavel Ponec
See Also:
Property, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
MapImplUjoMiddle()
          No parameters constuctor
MapImplUjoMiddle(java.util.HashMap<java.lang.String,java.lang.Object> aData)
           
 
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.mapImpl.MapImplUjo
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, newListProperty, newProperty, newProperty, put, putAll, readValue, remove, size, values, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ujoframework.Ujo
readAuthorization, readProperties, readValue, writeValue
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

MapImplUjoMiddle

public MapImplUjoMiddle(java.util.HashMap<java.lang.String,java.lang.Object> aData)

MapImplUjoMiddle

public MapImplUjoMiddle()
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 MapImplUjoMiddle>

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 MapImplUjoMiddle>

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 MapImplUjoMiddle>
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 MapImplUjoMiddle>
Parameters:
property - Property
value - String value


Copyright © 2010. All Rights Reserved.