|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.mappings.transformers.FieldTransformerAdapter org.eclipse.persistence.mappings.transformers.ConstantTransformer
public class ConstantTransformer
Purpose: Allows a field to always be mapped to a constant value. This allows default values to be provided for un-mapped fields.
org.eclipse.persistence.mappings.FieldTransformer
,
Serialized FormField Summary | |
---|---|
protected java.lang.Object |
value
|
Constructor Summary | |
---|---|
ConstantTransformer()
|
|
ConstantTransformer(java.lang.Object value)
PUBLIC: Return a constant transformer for the constant value. |
Method Summary | |
---|---|
java.lang.Object |
buildFieldValue(java.lang.Object object,
java.lang.String fieldName,
Session session)
INTERNAL: Always return the constant value. |
java.lang.Object |
getValue()
PUBLIC: Return the value of the constant. |
void |
setValue(java.lang.Object value)
PUBLIC: Set the value of the constant. |
Methods inherited from class org.eclipse.persistence.mappings.transformers.FieldTransformerAdapter |
---|
initialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object value
Constructor Detail |
---|
public ConstantTransformer()
public ConstantTransformer(java.lang.Object value)
Method Detail |
---|
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
public java.lang.Object buildFieldValue(java.lang.Object object, java.lang.String fieldName, Session session)
buildFieldValue
in interface FieldTransformer
buildFieldValue
in class FieldTransformerAdapter
object
- - an instance of the domain class which contains the attributefieldName
- - the name of the field being transformed. Used if the user wants to use this transformer for multiple fields.session
- - the current session
|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |