org.jpox.enhancer.method
Class MethodBuilder

java.lang.Object
  extended byorg.jpox.enhancer.method.ClassElementBuilder
      extended byorg.jpox.enhancer.method.MethodBuilder
Direct Known Subclasses:
CheckReadMethod, CheckWriteMethod, DefaultConstructor, InitFieldFlags, InitFieldNames, InitFieldTypes, InitPersistenceCapableSuperClass, IsXXXMethod, JdoCopyField, JdoCopyFields, JdoCopyKeyFieldsFromObjectId, JdoCopyKeyFieldsFromObjectId2, JdoCopyKeyFieldsToObjectId, JdoCopyKeyFieldsToObjectId2, JdoGetManagedFieldCount, JdoIsDetached, JdoIsDirty, JdoMakeDirty, JdoNewInstance1, JdoNewInstance2, JdoNewObjectIdInstance1, JdoNewObjectIdInstance2, JdoProvideField, JdoReplaceDetachedState, JdoReplaceField, JdoReplaceFlags, JdoReplaceStateManager, LoadClass, MediateReadMethod, MediateWriteMethod, NormalGetMethod, NormalSetMethod, ParentManagedFieldNum, ReplaceMethodCallback, SimpleStateManagerCall, SuperClone, SwitchInverseTarget, SwitchTarget, WriteObject

public class MethodBuilder
extends ClassElementBuilder

method generator class.

Version:
$Revision: 1.8 $

Field Summary
protected  java.lang.String[] argName
          Method argment names
protected  org.apache.bcel.generic.Type[] argType
          Method argment types
protected  org.apache.bcel.generic.InstructionFactory factory
          InstructionFactory instance
protected  org.apache.bcel.generic.InstructionList il
          InstructionList instance
protected static org.jpox.util.Localiser LOCALISER
          Mesasge resource
protected  org.apache.bcel.generic.MethodGen methodGen
          MethodGen instance
protected  java.lang.String methodName
          Method name
protected  org.apache.bcel.generic.Type resultType
          method result type
protected  boolean synthetic
          is synthetic
protected  int type
          Method type.
 
Fields inherited from class org.jpox.enhancer.method.ClassElementBuilder
classConfig, classGen, className, constantPoolGen, gen, jdoConfig, packageConfig
 
Constructor Summary
MethodBuilder(java.lang.String methodName, int type, org.apache.bcel.generic.Type resultType, org.apache.bcel.generic.Type[] argType, java.lang.String[] argName, boolean synthetic, GeneratorBase gen)
          Constructor.
 
Method Summary
 void close()
          Call after execute() method.
protected  org.apache.bcel.generic.InstructionHandle createThrowException(java.lang.String newException, java.lang.String message)
          Create throw exception instruction.
protected  org.apache.bcel.generic.InstructionHandle createThrowException(java.lang.String newException, java.lang.String message, org.apache.bcel.generic.Instruction intMessage)
          Create throw exception instruction.
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one.
 void execute()
          ClassElementBuilder routine
 int hashCode()
          Return hash code of this instance.
 void init()
          Instance initializer.
 boolean isSynthetic()
          return true if this method is synthetic
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static org.jpox.util.Localiser LOCALISER
Mesasge resource


methodName

protected java.lang.String methodName
Method name


type

protected int type
Method type.
eg. public static final ...


resultType

protected org.apache.bcel.generic.Type resultType
method result type


argType

protected org.apache.bcel.generic.Type[] argType
Method argment types


argName

protected java.lang.String[] argName
Method argment names


factory

protected org.apache.bcel.generic.InstructionFactory factory
InstructionFactory instance


il

protected org.apache.bcel.generic.InstructionList il
InstructionList instance


methodGen

protected org.apache.bcel.generic.MethodGen methodGen
MethodGen instance


synthetic

protected boolean synthetic
is synthetic

Constructor Detail

MethodBuilder

public MethodBuilder(java.lang.String methodName,
                     int type,
                     org.apache.bcel.generic.Type resultType,
                     org.apache.bcel.generic.Type[] argType,
                     java.lang.String[] argName,
                     boolean synthetic,
                     GeneratorBase gen)
Constructor.

Parameters:
methodName - method name
type - bcel method type
resultType - return type
argType - argment types
argName - argment names
synthetic - synthetic method
gen - Generator base
Method Detail

hashCode

public int hashCode()
Return hash code of this instance.

Returns:
hash code of this instance

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.

Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

init

public void init()
Description copied from class: ClassElementBuilder
Instance initializer. call before execute();

Overrides:
init in class ClassElementBuilder

execute

public void execute()
Description copied from class: ClassElementBuilder
ClassElementBuilder routine

Specified by:
execute in class ClassElementBuilder

close

public void close()
Description copied from class: ClassElementBuilder
Call after execute() method.

Overrides:
close in class ClassElementBuilder

isSynthetic

public boolean isSynthetic()
return true if this method is synthetic

Returns:
synthetic flag

createThrowException

protected org.apache.bcel.generic.InstructionHandle createThrowException(java.lang.String newException,
                                                                         java.lang.String message,
                                                                         org.apache.bcel.generic.Instruction intMessage)
Create throw exception instruction.
this method generate below code...
throw new [newExceptin param class]([message param]+[intMessage param]);

Parameters:
newException - throw exception
message - exception message
intMessage - exception message append ,like ICONST_2 or ILOAD_1
Returns:
first InstructionHandle

createThrowException

protected org.apache.bcel.generic.InstructionHandle createThrowException(java.lang.String newException,
                                                                         java.lang.String message)
Create throw exception instruction.
this method generate below code...
throw new [newExceptin param class]([message param]);

Parameters:
newException - throw exception
message - exception message
Returns:
first InstructionHandle


Copyright © -2007 . All Rights Reserved.