2 * Copyright (c) 2013 Cisco Systems, Inc. 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
8 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.directives;
10 import java.io.IOException;
11 import java.io.Writer;
14 import freemarker.core.Environment;
15 import freemarker.template.TemplateDirectiveBody;
16 import freemarker.template.TemplateDirectiveModel;
17 import freemarker.template.TemplateException;
18 import freemarker.template.TemplateModel;
21 * Add annotations to freemarker template.
23 public class UnimplementedExceptionDirective implements TemplateDirectiveModel {
26 public void execute(Environment env, Map params, TemplateModel[] loopVars,
27 TemplateDirectiveBody body) throws TemplateException, IOException {
29 Writer out = env.getOut();
30 StringBuilder build = new StringBuilder();
32 build.append("throw new "
33 + UnsupportedOperationException.class.getCanonicalName()
34 + "(\"Unimplemented stub method\");");
35 build.append(System.lineSeparator());
37 out.write(build.toString().toCharArray());