/** * The list of imported schemas. * * @return The list of imported schemas. */ public List<SchemaInfo> getImportedSchemas() { Set<String> importedNamespaces = getImportedNamespaces(); importedNamespaces.remove(getTargetNamespace()); //the "associated" schema is either inlined or included, but not imported. List<SchemaInfo> schemas = new ArrayList<SchemaInfo>(); for (String ns : importedNamespaces) { SchemaInfo schema = lookupSchema(ns); if (schema != null) { schemas.add(schema); } } return schemas; }
/** * The list of imported schemas. * * @return The list of imported schemas. */ public List<SchemaInfo> getImportedSchemas() { Set<String> importedNamespaces = getImportedNamespaces(); importedNamespaces.remove(getTargetNamespace()); //the "associated" schema is either inlined or included, but not imported. List<SchemaInfo> schemas = new ArrayList<SchemaInfo>(); for (String ns : importedNamespaces) { SchemaInfo schema = lookupSchema(ns); if (schema != null) { schemas.add(schema); } } return schemas; }
@Override public TemplateModel get(String key) throws TemplateModelException { if (("filename".equals(key)) || ("location".equals(key)) || ("inlineSchema".equals(key))) { return wrap(wsdlInfo.getProperty(key)); } else if ("importedNamespaces".equals(key)) { Set<String> importedNamespaces = wsdlInfo.getImportedNamespaces(); SchemaInfo associatedSchema = wsdlInfo.getAssociatedSchema(); Boolean inlineSchema = (Boolean) wsdlInfo.getProperty("inlineSchema"); if (associatedSchema != null && inlineSchema != null && inlineSchema) { importedNamespaces.addAll(associatedSchema.getReferencedNamespaces()); } return wrap(importedNamespaces); } else if ("importedSchemas".equals(key)) { TreeSet<SchemaInfo> schemas = new TreeSet<SchemaInfo>(new SchemaInfoComparator()); schemas.addAll(wsdlInfo.getImportedSchemas()); SchemaInfo associatedSchema = wsdlInfo.getAssociatedSchema(); Boolean inlineSchema = (Boolean) wsdlInfo.getProperty("inlineSchema"); if (associatedSchema != null && inlineSchema != null && inlineSchema) { schemas.addAll(associatedSchema.getImportedSchemas()); } return wrap(schemas); } return super.get(key); } }