Methods Summary |
---|
public static org.hibernate.bytecode.javassist.FastClass | create(java.lang.Class type)
FastClass fc = new FastClass( type );
return fc;
|
public boolean | equals(java.lang.Object o)
if ( !( o instanceof FastClass ) ) {
return false;
}
return this.type.equals( ( ( FastClass ) o ).type );
|
public int | getIndex(java.lang.String name, java.lang.Class[] parameterTypes)
Method[] methods = this.type.getMethods();
boolean eq = true;
for ( int i = 0; i < methods.length; ++i ) {
if ( !Modifier.isPublic( methods[i].getModifiers() ) ) {
continue;
}
if ( !methods[i].getName().equals( name ) ) {
continue;
}
Class[] params = methods[i].getParameterTypes();
if ( params.length != parameterTypes.length ) {
continue;
}
eq = true;
for ( int j = 0; j < params.length; ++j ) {
if ( !params[j].equals( parameterTypes[j] ) ) {
eq = false;
break;
}
}
if ( eq ) {
return i;
}
}
return -1;
|
public int | getIndex(java.lang.Class[] parameterTypes)
Constructor[] conss = this.type.getConstructors();
boolean eq = true;
for ( int i = 0; i < conss.length; ++i ) {
if ( !Modifier.isPublic( conss[i].getModifiers() ) ) {
continue;
}
Class[] params = conss[i].getParameterTypes();
if ( params.length != parameterTypes.length ) {
continue;
}
eq = true;
for ( int j = 0; j < params.length; ++j ) {
if ( !params[j].equals( parameterTypes[j] ) ) {
eq = false;
break;
}
}
if ( eq ) {
return i;
}
}
return -1;
|
public java.lang.Class | getJavaClass()
return this.type;
|
public int | getMaxIndex()
Method[] methods = this.type.getMethods();
int count = 0;
for ( int i = 0; i < methods.length; ++i ) {
if ( Modifier.isPublic( methods[i].getModifiers() ) ) {
count++;
}
}
return count;
|
public java.lang.String | getName()
return this.type.getName();
|
public int | hashCode()
return this.type.hashCode();
|
public java.lang.Object | invoke(java.lang.String name, java.lang.Class[] parameterTypes, java.lang.Object obj, java.lang.Object[] args)
return this.invoke( this.getIndex( name, parameterTypes ), obj, args );
|
public java.lang.Object | invoke(int index, java.lang.Object obj, java.lang.Object[] args)
Method[] methods = this.type.getMethods();
try {
return methods[index].invoke( obj, args );
}
catch ( ArrayIndexOutOfBoundsException e ) {
throw new IllegalArgumentException(
"Cannot find matching method/constructor"
);
}
catch ( IllegalAccessException e ) {
throw new InvocationTargetException( e );
}
|
public java.lang.Object | newInstance()
return this.newInstance( this.getIndex( EMPTY_CLASS_ARRAY ), null );
|
public java.lang.Object | newInstance(java.lang.Class[] parameterTypes, java.lang.Object[] args)
return this.newInstance( this.getIndex( parameterTypes ), args );
|
public java.lang.Object | newInstance(int index, java.lang.Object[] args)
Constructor[] conss = this.type.getConstructors();
try {
return conss[index].newInstance( args );
}
catch ( ArrayIndexOutOfBoundsException e ) {
throw new IllegalArgumentException( "Cannot find matching method/constructor" );
}
catch ( InstantiationException e ) {
throw new InvocationTargetException( e );
}
catch ( IllegalAccessException e ) {
throw new InvocationTargetException( e );
}
|
public java.lang.String | toString()
return this.type.toString();
|