if( hint instanceof String ){
String name = (String) hint;
try {
dataSource = (DataSource) GeoTools.getInitialContext(userHints).lookup(name);
} catch (NamingException e) {
throw new FactoryException("A EPSG_DATA_SOURCE hint is required:"+e);
}
hints.put(Hints.EPSG_DATA_SOURCE, dataSource );
}
else if( hint instanceof DataSource ){
dataSource = (DataSource) hint;
hints.put(Hints.EPSG_DATA_SOURCE, dataSource );
}
else {
throw new FactoryException("A EPSG_DATA_SOURCE hint is required.");
}
}
else {
throw new FactoryException("A EPSG_DATA_SOURCE hint is required.");
}
}