1 23 24 30 31 package com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc; 32 33 import java.util.ResourceBundle ; 34 35 import com.sun.jdo.api.persistence.support.JDOFatalInternalException; 36 import com.sun.jdo.spi.persistence.support.sqlstore.ValueFetcher; 37 import com.sun.jdo.spi.persistence.utility.I18NHelper; 38 39 43 public class QueryValueFetcher implements ValueFetcher 44 { 45 46 protected final static ResourceBundle messages = 47 I18NHelper.loadBundle(QueryValueFetcher.class); 48 49 50 private Object [] parameters; 51 52 56 public QueryValueFetcher(Object [] parameters) 57 { 58 this.parameters = parameters; 59 } 60 61 66 public Object getValue(int whichOne) 67 { 68 if (parameters == null || whichOne >= parameters.length) 69 { 70 throw new JDOFatalInternalException(I18NHelper.getMessage(messages, 71 "jqlc.queryvaluefetcher.getvalue.invalidparam", String.valueOf(whichOne), 73 String.valueOf((parameters == null) ? 0 : parameters.length))); 74 } 75 return parameters[whichOne]; 76 } 77 } 78 | Popular Tags |