java/sql-dk/src/main/java/info/globalcode/sql/dk/InfoLister.java
branchv_0
changeset 246 277c18b48762
parent 238 4a1864c3e867
child 250 aae5009bd0af
equal deleted inserted replaced
245:b6ff5b7a8422 246:277c18b48762
   170 	}
   170 	}
   171 
   171 
   172 	private boolean isInstantiable(FormatterDefinition fd) {
   172 	private boolean isInstantiable(FormatterDefinition fd) {
   173 		try {
   173 		try {
   174 			try (ByteArrayOutputStream testStream = new ByteArrayOutputStream()) {
   174 			try (ByteArrayOutputStream testStream = new ByteArrayOutputStream()) {
   175 				fd.getInstance(new FormatterContext(testStream, new Properties(0)));
   175 				fd.getInstance(new FormatterContext(testStream, new Properties(0), null));
   176 				return true;
   176 				return true;
   177 			}
   177 			}
   178 		} catch (Exception e) {
   178 		} catch (Exception e) {
   179 			log.log(Level.SEVERE, "Unable to create an instance of formatter: " + fd.getName(), e);
   179 			log.log(Level.SEVERE, "Unable to create an instance of formatter: " + fd.getName(), e);
   180 			return false;
   180 			return false;
   556 
   556 
   557 	private Formatter getFormatter() throws ConfigurationException, FormatterException {
   557 	private Formatter getFormatter() throws ConfigurationException, FormatterException {
   558 		String formatterName = options.getFormatterName();
   558 		String formatterName = options.getFormatterName();
   559 		formatterName = formatterName == null ? Configuration.DEFAULT_FORMATTER_PREFETCHING : formatterName;
   559 		formatterName = formatterName == null ? Configuration.DEFAULT_FORMATTER_PREFETCHING : formatterName;
   560 		FormatterDefinition fd = configurationProvider.getConfiguration().getFormatter(formatterName);
   560 		FormatterDefinition fd = configurationProvider.getConfiguration().getFormatter(formatterName);
   561 		FormatterContext context = new FormatterContext(out, options.getFormatterProperties());
   561 		FormatterContext context = new FormatterContext(out, options.getFormatterProperties(), options.getRelationNames());
   562 		return fd.getInstance(context);
   562 		return fd.getInstance(context);
   563 	}
   563 	}
   564 
   564 
   565 	private ColumnsHeader constructHeader(HeaderField... fields) throws FormatterException {
   565 	private ColumnsHeader constructHeader(HeaderField... fields) throws FormatterException {
   566 		try {
   566 		try {