T - Type of proxied domain objectpublic class G9Proxy<T> extends Object implements DomainObjectProxy<T>
| Modifier and Type | Field and Description |
|---|---|
static boolean |
ZERO_VALUE_BOOLEAN
Default zero value for boolean
|
static byte |
ZERO_VALUE_BYTE
Default zero value for byte
|
static char |
ZERO_VALUE_CHAR
Default zero value for char
|
static double |
ZERO_VALUE_DOUBLE
Default zero value for double
|
static float |
ZERO_VALUE_FLOAT
Default zero value for float
|
static int |
ZERO_VALUE_INT
Default zero value for int
|
static long |
ZERO_VALUE_LONG
Default zero value for long
|
static short |
ZERO_VALUE_SHORT
Default zero value for short
|
| Constructor and Description |
|---|
G9Proxy(T domainObject,
G9Enums enums,
boolean useAccessMethods)
Creates a new G9Proxy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyStatus(DomainObjectProxy<?> fromProxy,
String fromAttributeName,
String toAttributeName)
Copies the status from an attribute in
fromProxy. |
boolean |
equalsInitialValue(String attributeName,
Object value)
Checks if the specified value equals the original value from the domain
object.
|
void |
forceClean(String attributeName,
Object value)
Updates the specified value and sets the state of this attribute to
"clean"
|
void |
forceClean(T o)
Forces the proxy to hold a new object, which then are considered "clean"
|
Object |
getAttribute(String attributeName)
Returns the specified attribute with its current value.
|
Object |
getCleanVersionOfAttribute(String attributeName)
Returns the initial value of the specified attribute.
|
T |
getCleanVersionOfObject()
Returns the object in its initial state.
|
T |
getObject()
Returns the object in its current state, which might be clean, might
be dirty.
|
boolean |
isClean()
Quiering about the object state.
|
boolean |
isClean(String attributeName)
Quiering about the attribute state.
|
void |
reset()
Resets the object to its initial, clean state
|
void |
resetAttribute(String attributeName)
Resets the specified attribute to its original value.
|
void |
setAttribute(String attributeName,
Object attributeValue)
Sets an attribute.
|
String |
toString()
Returns a string representation of this proxy.
|
public static final byte ZERO_VALUE_BYTE
public static final short ZERO_VALUE_SHORT
public static final int ZERO_VALUE_INT
public static final char ZERO_VALUE_CHAR
public static final long ZERO_VALUE_LONG
public static final float ZERO_VALUE_FLOAT
public static final double ZERO_VALUE_DOUBLE
public static final boolean ZERO_VALUE_BOOLEAN
public G9Proxy(T domainObject, G9Enums enums, boolean useAccessMethods)
domainObject - the domain object that shall be proxiedenums - the application's enumeratorsuseAccessMethods - if true variables are accessed using
bean-style getter and setter methods.public boolean isClean()
DomainObjectProxytrue if the object
state is unchanged from the initial state (in other words clean).isClean in interface DomainObjectProxy<T>true if the proxied object is clean.public boolean isClean(String attributeName)
DomainObjectProxytrue if the
attribute is unchanged from it's original state.isClean in interface DomainObjectProxy<T>attributeName - (missing javadoc)public T getCleanVersionOfObject()
DomainObjectProxygetCleanVersionOfObject in interface DomainObjectProxy<T>public T getObject()
DomainObjectProxygetObject in interface DomainObjectProxy<T>public void setAttribute(String attributeName, Object attributeValue)
DomainObjectProxysetAttribute in interface DomainObjectProxy<T>attributeName - the name of the attribute to set.attributeValue - the new value of the specified attribute. Primitive
types must be wrapped.public Object getAttribute(String attributeName)
DomainObjectProxygetAttribute in interface DomainObjectProxy<T>attributeName - the name of the attribute to get.public void reset()
DomainObjectProxyreset in interface DomainObjectProxy<T>public void resetAttribute(String attributeName)
DomainObjectProxyresetAttribute in interface DomainObjectProxy<T>attributeName - the (declared) name of the attributepublic Object getCleanVersionOfAttribute(String attributeName)
DomainObjectProxygetCleanVersionOfAttribute in interface DomainObjectProxy<T>attributeName - (missing javadoc)public boolean equalsInitialValue(String attributeName, Object value)
DomainObjectProxy
String s1 = null;
String s2 = "";
String s3 = " ";
String orig1 = null;
Asuming orig1 is a reference to the domain-objects initial
value of the attribute, s1, s2 and
s3 are all considered equal to the origianal value.equalsInitialValue in interface DomainObjectProxy<T>attributeName - the (declared) name of the attributevalue - - object holding the value which sould be compared to the
initial valuetrue if the specified value equals the initial
value.public void forceClean(String attributeName, Object value)
forceClean in interface DomainObjectProxy<T>attributeName - the name of the attributevalue - the value to set on the attribute.public void forceClean(T o)
DomainObjectProxyforceClean in interface DomainObjectProxy<T>o - (missing javadoc)public void copyStatus(DomainObjectProxy<?> fromProxy, String fromAttributeName, String toAttributeName)
DomainObjectProxyfromProxy.copyStatus in interface DomainObjectProxy<T>fromProxy - (missing javadoc)fromAttributeName - (missing javadoc)toAttributeName - (missing javadoc)Copyright © 2006–2017 Esito AS. All rights reserved.