Class FieldInterceptorImpl

  extended by org.hibernate.bytecode.instrumentation.spi.AbstractFieldInterceptor
      extended by org.hibernate.bytecode.instrumentation.internal.javassist.FieldInterceptorImpl
All Implemented Interfaces:
Serializable, FieldInterceptor, FieldHandler

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

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.bytecode.instrumentation.spi.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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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
target - ?
name - The name of the field being written
oldValue - The old field value
newValue - The new field value.


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


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


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


public String toString()
toString in class Object

Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.