尝试从服务类中访问一个类的最终属性时,我得到了一个没有这样的属性错误。
在服务中,我有以下代码。
class ShiftService{
...
def getEvents(shift){
//if I try to access static final get error
def type=shiftEvent.START;
//NO SUCH PROPERTY shiftEvent for ShiftService
}
...
}
//currently in same ShiftService.groovy file
class shiftEvent{
static final String START="shiftStart";
static final String END="shiftEnd";
static final String DAY_BOUNDARY="dayBoundary";
static final String CHECKIN="individualCheckin";
static final String CHECKOUT="individualCheckout";
static final String NIGHT_START="individualNightStart";
static final String NIGHT_END="individualNightEnd";
...
}