2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.model.parser.builder;
\r
10 import org.opendaylight.controller.model.parser.api.Builder;
\r
11 import org.opendaylight.controller.yang.model.api.MustDefinition;
\r
12 import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;
\r
15 public class MustDefinitionBuilder implements Builder {
\r
17 private final MustDefinitionImpl instance;
\r
19 MustDefinitionBuilder(String xpathStr) {
\r
20 instance = new MustDefinitionImpl(xpathStr);
\r
24 public MustDefinition build() {
\r
28 public void setDescription(String description) {
\r
29 instance.setDescription(description);
\r
32 public void setReference(String reference) {
\r
33 instance.setReference(reference);
\r
36 private static class MustDefinitionImpl implements MustDefinition {
\r
38 private final String xpathStr;
\r
39 private String description;
\r
40 private String reference;
\r
42 private MustDefinitionImpl(String xpathStr) {
\r
43 this.xpathStr = xpathStr;
\r
47 public String getDescription() {
\r
50 private void setDescription(String description) {
\r
51 this.description = description;
\r
55 public String getErrorAppTag() {
\r
56 // TODO Auto-generated method stub
\r
61 public String getErrorMessage() {
\r
62 // TODO Auto-generated method stub
\r
67 public String getReference() {
\r
70 private void setReference(String reference) {
\r
71 this.reference = reference;
\r
75 public RevisionAwareXPath getXpath() {
\r
76 // TODO Auto-generated method stub
\r
81 public String toString() {
\r
82 return MustDefinitionImpl.class.getSimpleName() +"[xpathStr="+ xpathStr +"]";
\r