public static int classIndex(int luaState,Class clazz,String searchName) throws LuaException {
synchronized (LuaStateFactory.getExistingState(luaState)) {
    int res;
    res=checkField(luaState,clazz,searchName);
    if (res != 0) {
      return 1;
    }
    res=checkMethod(luaState,clazz,searchName);
    if (res != 0) {
      return 2;
    }
    return 0;
  }
}

public static int classIndex ( int luaState , Class clazz , String searchName ) throws LuaException { synchronized ( LuaStateFactory . getExistingState ( luaState ) ) { int res ; res = checkField ( luaState , clazz , searchName ) ; if ( res != 0 ) { return 1 ; } res = checkMethod ( luaState , clazz , searchName ) ; if ( res != 0 ) { return 2 ; } return 0 ; } }
java function to be called when a java class metamethod __index is called . this function returns 1 if there is a field with searchname and 2 if there is a method if the searchname
