@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof DefinitionsChildId)) return false; // only the same component instances might be equal if (!o.getClass().equals(this.getClass())) { return false; } if (!super.equals(o)) return false; DefinitionsChildId that = (DefinitionsChildId) o; return namespace.equals(that.namespace); }
/** * Finds out all imports belonging to the given namespace */ private Set<XSDImportId> getImportsOfNamespace(final Namespace namespace) { Objects.requireNonNull(namespace); // implemented using a straight-forward solution: get ALL XSD definitions and filter out the matching ones Set<XSDImportId> allImports = RepositoryFactory.getRepository().getAllDefinitionsChildIds(XSDImportId.class); return allImports.stream().filter(imp -> imp.getNamespace().equals(namespace)).collect(Collectors.toSet()); }
@GET @Path("alldefinedtypeslocalnames") public List<String> getAllDefinedTypesLocalNames() { return RepositoryFactory.getRepository().getXsdImportManager().getAllDefinedTypesLocalNames().stream() .filter(namespaceAndDefinedLocalNames -> namespaceAndDefinedLocalNames.getNamespace().equals(id.getNamespace())) .flatMap(namespaceAndDefinedLocalNames -> namespaceAndDefinedLocalNames.getDefinedLocalNames().stream()) .sorted() .collect(Collectors.toList()); } }
@GET @Path("alldeclaredelementslocalnames") public List<String> getAllDeclaredElementsLocalNames() { return RepositoryFactory.getRepository().getXsdImportManager().getAllDeclaredElementsLocalNames().stream() .filter(namespaceAndDefinedLocalNames -> namespaceAndDefinedLocalNames.getNamespace().equals(id.getNamespace())) .flatMap(namespaceAndDefinedLocalNames -> namespaceAndDefinedLocalNames.getDefinedLocalNames().stream()) .sorted() .collect(Collectors.toList()); }