Refine search
public Array(Class<T> arrayCls) { if (arrayCls == null || !arrayCls.isArray()) throw new IllegalArgumentException(_loc.get("fill-bad-array", arrayCls).getMessage()); this.cls = arrayCls.getComponentType(); }
public T fill(Object[] values, Class<?>[] types, String[] aliases) { try { return (T)values[0]; } catch (Exception e) { throw new RuntimeException(_loc.get("fill-assign-error", Arrays.toString(values), Arrays.toString(types)).getMessage(), e); } } }
public Array(Class<T> arrayCls) { if (arrayCls == null || !arrayCls.isArray()) throw new IllegalArgumentException(_loc.get("fill-bad-array", arrayCls).getMessage()); this.cls = arrayCls.getComponentType(); }
public Factory(ObjectFactory<T> factory, Method put) { this.factory = factory; this.putMethod = put; if (put == null || put.getParameterTypes().length != 2) throw new IllegalArgumentException(_loc.get("fill-factory-bad-put", put).getMessage()); Class<?> keyType = putMethod.getParameterTypes()[0]; this.isArray = keyType == int.class || keyType == Integer.class; }
public FetchConfiguration setLockScope(int scope) { if (scope != DEFAULT && scope != LockScopes.LOCKSCOPE_NORMAL && scope != LockScopes.LOCKSCOPE_EXTENDED) throw new IllegalArgumentException(_loc.get( "bad-lock-scope", Integer.valueOf(scope)).getMessage()); if (scope == DEFAULT ) _state.lockScope = LOCKSCOPE_NORMAL; else _state.lockScope = scope; return this; }
/** * Look up the metadata for a <code>PersistenceCapable</code> class. */ private static Meta getMeta(Class<?> pcClass) { Meta ret = (Meta) _metas.get(pcClass); if (ret == null) throw new IllegalStateException(_loc.get("no-meta", pcClass). getMessage()); return ret; }
public Map(Method put) { if (put == null || put.getParameterTypes().length != 2) throw new IllegalArgumentException(_loc.get("fill-bad-put", put).getMessage()); putMethod = put; }
public FetchConfiguration setLockScope(int scope) { if (scope != DEFAULT && scope != LockScopes.LOCKSCOPE_NORMAL && scope != LockScopes.LOCKSCOPE_EXTENDED) throw new IllegalArgumentException(_loc.get( "bad-lock-scope", Integer.valueOf(scope)).getMessage()); if (scope == DEFAULT ) _state.lockScope = LOCKSCOPE_NORMAL; else _state.lockScope = scope; return this; }
public Map(Method put) { if (put == null || put.getParameterTypes().length != 2) throw new IllegalArgumentException(_loc.get("fill-bad-put", put).getMessage()); putMethod = put; }
<X,Y> void validate(Field mField, Member<X, Y> member) { if (!ParameterizedType.class.isInstance(mField.getGenericType())) { throw new IllegalArgumentException(_loc.get("meta-bad-field", mField).getMessage()); } ParameterizedType mfType = (ParameterizedType)mField.getGenericType(); java.lang.reflect.Type[] args = mfType.getActualTypeArguments(); java.lang.reflect.Type owner = args[0]; if (member.getDeclaringType().getJavaType() != owner) throw new IllegalArgumentException(_loc.get("meta-bad-field-owner", mField, owner).getMessage()); }
/** * Helper method to throw a standard exception if the task is not given * any files to execute on. Implementations might call this method as * the first step in {@link #executeOn} to validate that they are given * files to work on. */ protected void assertFiles(String[] files) { if (files.length == 0) throw new BuildException(_loc.get("no-filesets").getMessage()); }
public void remove() { throw new UnsupportedOperationException(_loc.get("read-only") .getMessage()); } }
private static Method createJDBC3Method(Object key, String name, Class[] args) { try { Method m = Connection.class.getMethod(name, args); _jdbc3.put(key, m); return m; } catch (Throwable t) { throw new NestableRuntimeException(_loc.get("error-jdbc3") .getMessage(), t); } } }
public Object next() { if (_rl.isClosed()) throw new NoSuchElementException(_loc.get("closed").getMessage()); return _li.next(); }
public void accessingField(int idx) { if (!_access && !_loaded.get(idx)) // do not access the pc fields by implictly invoking _pc.toString() // may cause infinite loop if again tries to access unloaded field throw new IllegalStateException(_loc.get("unloaded-detached", Exceptions.toString(_pc)).getMessage()); }
public Object next() { if (_rl.isClosed()) throw new NoSuchElementException(_loc.get("closed").getMessage()); return _li.next(); }
public <X> X get(int i, Class<X> type) { if (i >= values.length || i < 0) { throw new IllegalArgumentException(_loc.get("tuple-exceeded-size", i, values.length).getMessage()); } Object val = values[i]; return assertAndConvertType(""+i, val, type); }
private static String getMessage(int iv) { switch (iv) { case IV_DUPLICATE_OID: return _loc.get("dup-oid").getMessage(); case IV_UNIQUE: return _loc.get("unique").getMessage(); default: return _loc.get("ref-integrity").getMessage(); } }
private static String getMessage(int iv) { switch (iv) { case IV_DUPLICATE_OID: return _loc.get("dup-oid").getMessage(); case IV_UNIQUE: return _loc.get("unique").getMessage(); default: return _loc.get("ref-integrity").getMessage(); } }
private Object invokeJDBC3(Method m, Object[] args) throws SQLException { try { return m.invoke(_conn, args); } catch (Throwable t) { if (t instanceof SQLException) throw(SQLException) t; throw new NestableRuntimeException(_loc.get("invoke-jdbc3") .getMessage(), t); } }