}
private MappingTreeStructure processStructure(DataStructure s) {
switch (s.getStructureType()) {
case Text: {
SimpleTextStructureMappingTreeConverter c = new SimpleTextStructureMappingTreeConverter();
return c.convert((SimpleTextStructure) s, callback);
}
case ComplexText: {
ComplexTextStructureMappingTreeConverter c = new ComplexTextStructureMappingTreeConverter();
return c.convert((ComplexTextStructure) s, callback);
}
case Database: {
DatabaseStructureMappingTreeConverter c = new DatabaseStructureMappingTreeConverter();
c.setLogger(logger);
return c.convert((DatabaseStructure) s, callback);
}
case LDAP: {
LdapStructureMappingTreeConverter c = new LdapStructureMappingTreeConverter();
return c.convert((LdapStructure) s, isTarget, callback);
}
case None: {
String xml = NoStructure.getJtr(isTarget);
MappingTreeStructure structure = MappingTreeStructureFactory.fromString(xml);
if (callback != null) {
callback.succeeded(structure);
}
return structure;
}
case WebServiceRequest: {
RequestStructureMappingTreeConverter c = new RequestStructureMappingTreeConverter();
return c.convert((WebServiceRequestStructure) s, isTarget, callback);
}
case WebServiceResponse: {
ResponseStructureMappingTreeConverter c = new ResponseStructureMappingTreeConverter();
return c.convert((WebServiceResponseStructure) s, isTarget, callback);
}
case XML: {
XmlStructureMappingTreeConverter c = new XmlStructureMappingTreeConverter();
return c.convert((XmlStructure) s, isTarget, callback);
}
case JSON: {
JsonStructureMappingTreeConverter c = new JsonStructureMappingTreeConverter();
return c.convert((JsonStructure) s, isTarget, callback);
}
default:
throw new RuntimeException("Unexpected structure type: " + s.getStructureType());
}
}