2 * Copyright (c) 2015 CableLabs and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.packetcable.provider.validation.impl.validators.ccaps;
11 import org.opendaylight.controller.packetcable.provider.validation.ValidationException;
12 import org.opendaylight.controller.packetcable.provider.validation.impl.validators.AbstractValidator;
13 import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.Ccaps;
14 import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccaps.Ccap;
19 public class CcapsValidator extends AbstractValidator<Ccaps> {
21 private final CcapValidator ccapValidator = new CcapValidator();
24 public void validate(final Ccaps ccaps, Extent extent) throws ValidationException {
26 throw new ValidationException("ccaps must exist");
29 if (extent == Extent.NODE_AND_SUBTREE) {
30 for (Ccap ccap : ccaps.getCcap()) {
31 validateChild(ccapValidator, ccap);