da5392919c53ba78725969c09d52be6d6e3d5a8f
[controller.git] / opendaylight / config / yang-jmx-generator / src / main / java / org / opendaylight / controller / config / yangjmxgenerator / attribute / ListDependenciesAttribute.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.yangjmxgenerator.attribute;
9
10 import java.util.List;
11 import javax.management.ObjectName;
12 import javax.management.openmbean.ArrayType;
13 import javax.management.openmbean.OpenType;
14 import javax.management.openmbean.SimpleType;
15 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
16 import org.opendaylight.mdsal.binding.generator.util.Types;
17 import org.opendaylight.mdsal.binding.model.api.Type;
18 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
19
20 public class ListDependenciesAttribute extends AbstractDependencyAttribute {
21
22     public ListDependenciesAttribute(final DataSchemaNode attrNode, final ServiceInterfaceEntry sie, final boolean mandatory, final String nullableDescription) {
23         super(attrNode, sie, mandatory, nullableDescription);
24     }
25
26     @Override
27     public Type getType() {
28         return Types.parameterizedTypeFor(Types.typeForClass(List.class), Types.typeForClass(ObjectName.class));
29     }
30
31     @Override
32     public ArrayType<?> getOpenType() {
33         final OpenType<?> innerOpenType = SimpleType.OBJECTNAME;
34         return ListAttribute.constructArrayType(innerOpenType);
35     }
36
37 }