@Test public void testAbcd2() throws IOException { String xml = Resources.toString( Resources.getResource("response_schema/abcd2.xml"), StandardCharsets.UTF_8); OccurrenceSchemaType result = detector.detectSchema(xml); assertEquals(OccurrenceSchemaType.ABCD_2_0_6, result); }
public OccurrenceSchemaType detectSchema(String xml) { OccurrenceSchemaType result = null; for (OccurrenceSchemaType schema : schemaSearchOrder) { log.debug("Checking for schema [{}]", schema); boolean success = checkElements(xml, distinctiveElements.get(schema).values()); if (success) { result = schema; break; } } if (result == null) { log.warn("Could not determine schema for xml [{}]", xml); } return result; }
ResponseSchemaDetector { public OccurrenceSchemaType detectSchema(String xml) { OccurrenceSchemaType result = null; for (OccurrenceSchemaType schema : schemaSearchOrder) { log.debug("Checking for schema [{}]", schema); boolean success = checkElements(xml, distinctiveElements.get(schema).values()); if (success) { result = schema; break; } } if (result == null) { log.warn("Could not determine schema for xml [{}]", xml); } return result; } }
ResponseSchemaDetector { public OccurrenceSchemaType detectSchema(String xml) { OccurrenceSchemaType result = null; for (OccurrenceSchemaType schema : schemaSearchOrder) { log.debug("Checking for schema [{}]", schema); boolean success = checkElements(xml, distinctiveElements.get(schema).values()); if (success) { result = schema; break; } } if (result == null) { log.warn("Could not determine schema for xml [{}]", xml); } return result; } ResponseSchemaDetector(); }
ResponseSchemaDetector { public OccurrenceSchemaType detectSchema(String xml) { OccurrenceSchemaType result = null; for (OccurrenceSchemaType schema : schemaSearchOrder) { log.debug("Checking for schema [{}]", schema); boolean success = checkElements(xml, distinctiveElements.get(schema).values()); if (success) { result = schema; break; } } if (result == null) { log.warn("Could not determine schema for xml [{}]", xml); } return result; } ResponseSchemaDetector(); OccurrenceSchemaType detectSchema(String xml); Map<ResponseElementEnum, String> getResponseElements(OccurrenceSchemaType schemaType); }
ResponseSchemaDetector { public OccurrenceSchemaType detectSchema(String xml) { OccurrenceSchemaType result = null; for (OccurrenceSchemaType schema : schemaSearchOrder) { log.debug("Checking for schema [{}]", schema); boolean success = checkElements(xml, distinctiveElements.get(schema).values()); if (success) { result = schema; break; } } if (result == null) { log.warn("Could not determine schema for xml [{}]", xml); } return result; } ResponseSchemaDetector(); OccurrenceSchemaType detectSchema(String xml); Map<ResponseElementEnum, String> getResponseElements(OccurrenceSchemaType schemaType);  }