@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TImportDefinition)) return false; TImportDefinition that = (TImportDefinition) o; return Objects.equals(getFile(), that.getFile()) && Objects.equals(getRepository(), that.getRepository()) && Objects.equals(getNamespaceUri(), that.getNamespaceUri()) && Objects.equals(getNamespacePrefix(), that.getNamespacePrefix()); }
@Override public int hashCode() { return Objects.hash(getFile(), getRepository(), getNamespaceUri(), getNamespacePrefix()); }
public TServiceTemplate readImportDefinition(TImportDefinition definition, Path path, String namespace) throws MultiException { if (Objects.isNull(definition) || Objects.isNull(definition.getFile())) return null; String importNamespace = definition.getNamespaceUri() == null ? namespace : definition.getNamespaceUri(); if (Objects.nonNull(definition.getRepository())) { // TODO Support Repositories return null; } else { return readServiceTemplate(path, Paths.get(definition.getFile()), importNamespace); } } }
@Override public String toString() { return "TImportDefinition{" + "file='" + getFile() + '\'' + ", repository=" + getRepository() + ", namespaceUri='" + getNamespaceUri() + '\'' + ", namespacePrefix='" + getNamespacePrefix() + '\'' + '}'; }
@Override public Result visit(TImportDefinition node, Parameter parameter) { if (!isDefined(node.getRepository(), definitionsVisitor.getRepositoryDefinitions())) { setException(new UndefinedField( "Repository definition '{}' is undefined", node.getRepository() ).setContext(parameter.getContext()) ); } return super.visit(node, parameter); }
public Printer visit(TImportDefinition node, Parameter parameter) { return new Printer(parameter.getIndent()) .printKeyValue("file", node.getFile()) .printKeyValue("repository", node.getRepository()) .printKeyValue("namespace_uri", node.getNamespaceUri(), !node.getNamespaceUri().equals(Namespaces.DEFAULT_NS)) .printKeyValue("namespace_prefix", node.getNamespacePrefix()); }