public EnhancedReport validateContent( String content, String profile, String constraints, String vs, String id, Context context) throws Exception { Report r = Validation.validate(profile, constraints, vs, content, id); String pr = Util.streamAsString(profile); String ctx = ""; if (context == Context.Free) ctx = "Context-Free"; else ctx = "Context-Based"; ArrayList<Section> mds = new ArrayList<Section>(); mds.add(service); return EnhancedReport.fromValidation(r, content, pr, id, mds, ctx); }
/** * @param content Message content * @param profile Profile content * @param constraints Constraints Object * @param vs ValueSetsLibrary Object * @param id Message id * @param context Context Free or Context Based * @throws Exception */ public EnhancedReport validate( String content, String profile, ConformanceContext constraints, ValueSetLibrary vs, String id, Context context) throws Exception { InputStream stream = new ByteArrayInputStream(profile.getBytes(StandardCharsets.UTF_8)); Profile profileX = XMLDeserializer.deserialize(stream).get(); Report r = Validation.validate(profileX, constraints, vs, content, id); String pr = profile; String ctx = ""; if (context == Context.Free) ctx = "Context-Free"; else ctx = "Context-Based"; ArrayList<Section> mds = new ArrayList<Section>(); mds.add(service); return EnhancedReport.fromValidation(r, content, pr, id, mds, ctx); }