/** * Creates a parameter descriptor from a code. * * @throws FactoryException if the object creation failed. */ @Override public ParameterDescriptor createParameterDescriptor(final String code) throws FactoryException { return getGeotoolsFactory("createParameterDescriptor", code) .createParameterDescriptor(toBackingFactoryCode(code)); }
/** * Returns all parameter descriptors for the specified method. * * @param method The operation method code. * @return The parameter descriptors. * @throws SQLException if a SQL statement failed. */ private ParameterDescriptor[] createParameterDescriptors(final String method) throws FactoryException, SQLException { final PreparedStatement stmt; stmt = prepareStatement( "ParameterDescriptors", // Must be plural form. "SELECT PARAMETER_CODE" + " FROM [Coordinate_Operation Parameter Usage]" + " WHERE COORD_OP_METHOD_CODE = ?" + " ORDER BY SORT_ORDER"); stmt.setInt(1, Integer.parseInt(method)); final ResultSet results = stmt.executeQuery(); final List<ParameterDescriptor> descriptors = new ArrayList<ParameterDescriptor>(); while (results.next()) { final String param = getString(results, 1, method); descriptors.add(buffered.createParameterDescriptor(param)); } results.close(); return descriptors.toArray(new ParameterDescriptor[descriptors.size()]); }
/** * Creates a parameter descriptor from a code. * * @throws FactoryException if the object creation failed for all factories. */ @Override public ParameterDescriptor createParameterDescriptor(final String code) throws FactoryException { try { return super.createParameterDescriptor(code); } catch (FactoryException exception) { notifyFailure("createParameterDescriptor", exception); try { return fallback.createParameterDescriptor(code); } catch (NoSuchAuthorityCodeException ignore) { throw exception; } } }
/** Returns a parameter descriptor from a code. */ @Override public synchronized ParameterDescriptor createParameterDescriptor(final String code) throws FactoryException { final ParameterDescriptor parameter; final String key = trimAuthority(code); final Object cached = objectCache.get(key); if (cached instanceof ParameterDescriptor) { parameter = (ParameterDescriptor) cached; } else { parameter = getBackingStore().createParameterDescriptor(code); } objectCache.put(key, parameter); return parameter; }
/** * Returns a parameter descriptor from a code. * * @throws FactoryException if the object creation failed. * @since 2.2 */ @Override public synchronized ParameterDescriptor createParameterDescriptor(final String code) throws FactoryException { final ParameterDescriptor parameter; final String key = trimAuthority(code); final Object cached = get(key); if (cached instanceof ParameterDescriptor) { parameter = (ParameterDescriptor) cached; } else { parameter = getBackingStore().createParameterDescriptor(code); } put(key, parameter); return parameter; }
return buffered.createOperationMethod(code); case 8: return buffered.createParameterDescriptor(code); case 9: break; // Can't cast Unit to IdentifiedObject