private Operation checkValidOperation(Link link) { String opId = link.getOperationId(); String operationRef = link.getOperationRef(); Operation op = null; if (opId == null && operationRef == null) { results.addError(msg(NoOpIdNoOpRefInLink), value); } else if (opId != null && operationRef != null) { results.addError(msg(OpIdAndOpRefInLink), value); } if (opId != null) { op = findOperationById(Overlay.of(link).getModel(), opId); if (op == null) { results.addError(msg(OpIdNotFound, opId), value); } } String relativePath = getRelativePath(operationRef, results); if (relativePath != null) { op = findOperationByPath(Overlay.of(link).getModel(), relativePath, results); if (op == null) { results.addError(msg(OpPathNotFound, operationRef), value); } } return op; }
private Operation checkValidOperation(Link link) { String opId = link.getOperationId(); String operationRef = link.getOperationRef(); Operation op = null; if (opId == null && operationRef == null) { results.addError(msg(NoOpIdNoOpRefInLink), value); } else if (opId != null && operationRef != null) { results.addError(msg(OpIdAndOpRefInLink), value); } if (opId != null) { op = findOperationById(Overlay.of(link).getModel(), opId); if (op == null) { results.addError(msg(OpIdNotFound, opId), value); } } String relativePath = getRelativePath(operationRef, results); if (relativePath != null) { op = findOperationByPath(Overlay.of(link).getModel(), relativePath, results); if (op == null) { results.addError(msg(OpPathNotFound, operationRef), value); } } return op; }