Errai 3.0.1-SNAPSHOT

org.jboss.errai.databinding.client.api
Enum InitialState

java.lang.Object
  extended by java.lang.Enum<InitialState>
      extended by org.jboss.errai.databinding.client.api.InitialState
All Implemented Interfaces:
Serializable, Comparable<InitialState>

public enum InitialState
extends Enum<InitialState>

Specifies the state from which a DataBinder's properties should be initialized.

Author:
Lincoln Baxter, III, Jonathan Fuerth , Christian Sadilek

Enum Constant Summary
FROM_MODEL
          Specifies that the bound value should be initialized to the pre-existing value in the model.
FROM_UI
          Specifies that the bound value should be initialized to the pre-existing value in the UI widget.
 
Method Summary
abstract
<T> T
getInitialValue(T modelValue, T widgetValue)
          Returns the model value or the UI value, as appropriate.
static InitialState valueOf(String name)
          Returns the enum constant of this type with the specified name.
static InitialState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

FROM_MODEL

public static final InitialState FROM_MODEL
Specifies that the bound value should be initialized to the pre-existing value in the model.


FROM_UI

public static final InitialState FROM_UI
Specifies that the bound value should be initialized to the pre-existing value in the UI widget.

Method Detail

values

public static InitialState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (InitialState c : InitialState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static InitialState valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getInitialValue

public abstract <T> T getInitialValue(T modelValue,
                                      T widgetValue)
Returns the model value or the UI value, as appropriate.

Parameters:
modelValue - The pre-existing model value.
widgetValue - The pre-existing UI widget value.
Returns:
Either model or widget. Return value will be null if the corresponding parameter value is null.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.