public ExmlValidator(ExmlConfiguration config) { this.config = config; exmlSchemaSourceByNamespace = new HashMap<String, ExmlSchemaSource>(); addClasspathXsdMappings(exmlSchemaSourceByNamespace); addXsdMappingsFromFilesInDirectory(exmlSchemaSourceByNamespace, this.config.getResourceOutputDirectory()); }
public ExmlValidator(ExmlConfiguration config) { this.config = config; exmlSchemaSourceByNamespace = new HashMap<String, ExmlSchemaSource>(); addClasspathXsdMappings(exmlSchemaSourceByNamespace); addXsdMappingsFromFilesInDirectory(exmlSchemaSourceByNamespace, this.config.getResourceOutputDirectory()); }
public ExmlConfiguration parseConfig(CmdLineParser parser, ExmlConfiguration config) { if (config.getOutputDirectory() == null) { System.out.println(extendedUsage(parser, null)); // NOSONAR this is a cmd line tool return null; } if (!config.getOutputDirectory().exists()) { throw new IllegalArgumentException("destination directory does not exist: " + config.getOutputDirectory().getAbsolutePath()); } if (config.getResourceOutputDirectory() == null) { config.setResourceOutputDirectory(config.getOutputDirectory()); } return config; }
public ExmlConfiguration parseConfig(CmdLineParser parser, ExmlConfiguration config) { if (config.getOutputDirectory() == null) { System.out.println(extendedUsage(parser, null)); // NOSONAR this is a cmd line tool return null; } if (!config.getOutputDirectory().exists()) { throw new IllegalArgumentException("destination directory does not exist: " + config.getOutputDirectory().getAbsolutePath()); } if (config.getResourceOutputDirectory() == null) { config.setResourceOutputDirectory(config.getOutputDirectory()); } return config; }
@Override public File generateXsd() { // Maybe even the directory does not exist. File targetPackageFolder = getConfig().getResourceOutputDirectory(); if(!targetPackageFolder.exists()) { //noinspection ResultOfMethodCallIgnored targetPackageFolder.mkdirs(); // NOSONAR } File result = new File(targetPackageFolder, getConfig().getConfigClassPackage() + ".xsd"); Writer writer = null; try { writer = new OutputStreamWriter(new FileOutputStream(result), net.jangaroo.exml.api.Exmlc.OUTPUT_CHARSET); configClassRegistry.generateXsd(writer); } catch (Exception e) { throw new ExmlcException("unable to generate xsd file: " + e.getMessage(), e); } finally { try { if (writer != null) { writer.close(); } } catch (IOException e) { //never happen } } return result; }
@Override public File generateXsd() { // Maybe even the directory does not exist. File targetPackageFolder = getConfig().getResourceOutputDirectory(); if(!targetPackageFolder.exists()) { //noinspection ResultOfMethodCallIgnored targetPackageFolder.mkdirs(); // NOSONAR } File result = new File(targetPackageFolder, getConfig().getConfigClassPackage() + ".xsd"); Writer writer = null; try { writer = new OutputStreamWriter(new FileOutputStream(result), net.jangaroo.exml.api.Exmlc.OUTPUT_CHARSET); configClassRegistry.generateXsd(writer); } catch (Exception e) { throw new ExmlcException("unable to generate xsd file: " + e.getMessage(), e); } finally { try { if (writer != null) { writer.close(); } } catch (IOException e) { //never happen } } return result; }