org.hibernate.intercept.javassist
Class FieldInterceptorImpl

java.lang.Object
  extended by org.hibernate.intercept.AbstractFieldInterceptor
      extended by org.hibernate.intercept.javassist.FieldInterceptorImpl
All Implemented Interfaces:
Serializable, FieldHandler, FieldInterceptor

public final class FieldInterceptorImpl
extends AbstractFieldInterceptor
implements FieldHandler, Serializable

A field-level interceptor that initializes lazily fetched properties. This interceptor can be attached to classes instrumented by Javassist. Note that this implementation assumes that the instance variable name is the same as the name of the persistent property that must be loaded.

Note: most of the interesting functionality here is farmed off to the super-class. The stuff here mainly acts as an adapter to the Javassist-specific functionality, routing interception through the super-class's intercept() method

Author:
Steve Ebersole
See Also:
Serialized Form

Method Summary
 boolean readBoolean(Object target, String name, boolean oldValue)
           
 byte readByte(Object target, String name, byte oldValue)
           
 char readChar(Object target, String name, char oldValue)
           
 double readDouble(Object target, String name, double oldValue)
           
 float readFloat(Object target, String name, float oldValue)
           
 int readInt(Object target, String name, int oldValue)
           
 long readLong(Object target, String name, long oldValue)
           
 Object readObject(Object target, String name, Object oldValue)
           
 short readShort(Object target, String name, short oldValue)
           
 String toString()
           
 boolean writeBoolean(Object target, String name, boolean oldValue, boolean newValue)
           
 byte writeByte(Object target, String name, byte oldValue, byte newValue)
           
 char writeChar(Object target, String name, char oldValue, char newValue)
           
 double writeDouble(Object target, String name, double oldValue, double newValue)
           
 float writeFloat(Object target, String name, float oldValue, float newValue)
           
 int writeInt(Object target, String name, int oldValue, int newValue)
          Called to handle writing an int value to a given field.
 long writeLong(Object target, String name, long oldValue, long newValue)
           
 Object writeObject(Object target, String name, Object oldValue, Object newValue)
           
 short writeShort(Object target, String name, short oldValue, short newValue)
           
 
Methods inherited from class org.hibernate.intercept.AbstractFieldInterceptor
clearDirty, dirty, getEntityName, getSession, getUninitializedFields, intercept, isDirty, isInitialized, isInitialized, isInitializing, setSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

readBoolean

public boolean readBoolean(Object target,
                           String name,
                           boolean oldValue)
Specified by:
readBoolean in interface FieldHandler

readByte

public byte readByte(Object target,
                     String name,
                     byte oldValue)
Specified by:
readByte in interface FieldHandler

readChar

public char readChar(Object target,
                     String name,
                     char oldValue)
Specified by:
readChar in interface FieldHandler

readDouble

public double readDouble(Object target,
                         String name,
                         double oldValue)
Specified by:
readDouble in interface FieldHandler

readFloat

public float readFloat(Object target,
                       String name,
                       float oldValue)
Specified by:
readFloat in interface FieldHandler

readInt

public int readInt(Object target,
                   String name,
                   int oldValue)
Specified by:
readInt in interface FieldHandler

readLong

public long readLong(Object target,
                     String name,
                     long oldValue)
Specified by:
readLong in interface FieldHandler

readShort

public short readShort(Object target,
                       String name,
                       short oldValue)
Specified by:
readShort in interface FieldHandler

readObject

public Object readObject(Object target,
                         String name,
                         Object oldValue)
Specified by:
readObject in interface FieldHandler

writeBoolean

public boolean writeBoolean(Object target,
                            String name,
                            boolean oldValue,
                            boolean newValue)
Specified by:
writeBoolean in interface FieldHandler

writeByte

public byte writeByte(Object target,
                      String name,
                      byte oldValue,
                      byte newValue)
Specified by:
writeByte in interface FieldHandler

writeChar

public char writeChar(Object target,
                      String name,
                      char oldValue,
                      char newValue)
Specified by:
writeChar in interface FieldHandler

writeDouble

public double writeDouble(Object target,
                          String name,
                          double oldValue,
                          double newValue)
Specified by:
writeDouble in interface FieldHandler

writeFloat

public float writeFloat(Object target,
                        String name,
                        float oldValue,
                        float newValue)
Specified by:
writeFloat in interface FieldHandler

writeInt

public int writeInt(Object target,
                    String name,
                    int oldValue,
                    int newValue)
Description copied from interface: FieldHandler
Called to handle writing an int value to a given field.

Specified by:
writeInt in interface FieldHandler
Parameters:
target - ?
name - The name of the field being written
oldValue - The old field value
newValue - The new field value.
Returns:
?

writeLong

public long writeLong(Object target,
                      String name,
                      long oldValue,
                      long newValue)
Specified by:
writeLong in interface FieldHandler

writeShort

public short writeShort(Object target,
                        String name,
                        short oldValue,
                        short newValue)
Specified by:
writeShort in interface FieldHandler

writeObject

public Object writeObject(Object target,
                          String name,
                          Object oldValue,
                          Object newValue)
Specified by:
writeObject in interface FieldHandler

toString

public String toString()
Overrides:
toString in class Object


Copyright © null-null Red Hat Middleware, LLC. All Rights Reserved