/** * Constructor. * * @param global schema customization root element * @param root URL for base of schema paths * @param target destination directory for code generation */ public CodeGen(SchemasetCustom global, URL root, File target) { m_global = global; addDefaultSubstitutions(m_global); m_targetDir = target; m_validationContext = new ValidationContext(); }
/** * Load the customizations file. This method must load the specified customizations file, or create a default * customizations instance, of the appropriate type. * * @param path customization file path * @return <code>true</code> if successful, <code>false</code> if an error * @throws JiBXException JiBX error * @throws IOException I/O error */ protected boolean loadCustomizations(String path) throws JiBXException, IOException { // load customizations and check for errors String[] spaths = (String[])m_sourcePaths.toArray(new String[m_sourcePaths.size()]); ValidationContext vctx = new ValidationContext(); loadCustomizations(path, new ClassSourceLocator(spaths), vctx); ArrayList probs = vctx.getProblems(); if (probs.size() > 0) { for (int i = 0; i < probs.size(); i++) { ValidationProblem prob = (ValidationProblem)probs.get(i); System.out.print(prob.getSeverity() >= ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: "); System.out.println(prob.getDescription()); } if (vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) { return false; } } return true; }
org.jibx.schema.validation.ValidationContext vctx = new org.jibx.schema.validation.ValidationContext(); for (int i = 0; i < holders.size(); i++) { SchemaHolder holder = (SchemaHolder)holders.get(i);
/** * Constructor. * * @param parms command line parameters */ public Refactory(RefactoryCommandLine parms) { m_global = parms.getCustomRoot(); m_global.setSubstitutions(DEFAULT_REPLACEMENTS); m_schemaRoot = parms.getSchemaRoot(); m_schemaDir = parms.getSchemaDir(); m_targetDir = parms.getGeneratePath(); m_validationContext = new ValidationContext(); }
ValidationContext vctx = new ValidationContext(); m_customRoot = new SchemasetCustom((SchemasetCustom)null); if (path != null) {
ValidationContext vctx = new ValidationContext(); ValidationUtils.load(resolves, null, vctx); ProblemMultiHandler handler = new ProblemMultiHandler();
ValidationContext vctx = new ValidationContext(); if (path == null) { custom = new SchemasetCustom((SchemasetCustom)null);