public int compare(SchemaInfo info1, SchemaInfo info2) { String namespace1 = info1.getNamespace(); if (namespace1 == null) { namespace1 = ""; } String namespace2 = info2.getNamespace(); if (namespace2 == null) { namespace2 = ""; } return namespace1.compareTo(namespace2); } }
/** * Whether this is the schema for the empty namespace. * * @return Whether this is the schema for the empty namespace. */ public boolean isEmptyNamespace() { return ((getNamespace() == null) || "".equals(getNamespace())); }
/** * Whether this is the schema for the empty namespace. * * @return Whether this is the schema for the empty namespace. */ public boolean isEmptyNamespace() { return ((getNamespace() == null) || "".equals(getNamespace())); }
/** * The list of imported schemas. * * @return The list of imported schemas. */ public List<SchemaInfo> getImportedSchemas() { Set<String> importedNamespaces = getReferencedNamespaces(); importedNamespaces.remove(getNamespace() == null ? "" : getNamespace()); List<SchemaInfo> schemas = new ArrayList<SchemaInfo>(); for (String ns : importedNamespaces) { SchemaInfo schema = lookupSchema(ns); if (schema != null) { schemas.add(schema); } else { SchemaInfo schemaInfo = new SchemaInfo(); schemaInfo.setNamespace(ns); schemas.add(schemaInfo); } } return schemas; }
/** * The list of imported schemas. * * @return The list of imported schemas. */ public List<SchemaInfo> getImportedSchemas() { Set<String> importedNamespaces = getReferencedNamespaces(); importedNamespaces.remove(getNamespace()); List<SchemaInfo> schemas = new ArrayList<SchemaInfo>(); for (String ns : importedNamespaces) { SchemaInfo schema = lookupSchema(ns); if (schema != null) { schemas.add(schema); } else { SchemaInfo schemaInfo = new SchemaInfo(); schemaInfo.setNamespace(ns); schemas.add(schemaInfo); } } return schemas; }
referencedNamespaces.add(getNamespace());
String prefix = ns2prefix.get(schemaInfo.getNamespace()); if (prefix != null) { String file = prefix + ".xsd"; schemaArtifact.setDescription("Schema file for namespace " + schemaInfo.getNamespace()); getEnunciate().addArtifact(schemaArtifact);