Comments of source code.
[yangtools.git] / code-generator / binding-model-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / CodeGenerator.java
index df6a5f6ebbe04d052f33951e7557afc53abc0896..e0dff52be93cf7c24ef1ccf464d1a40db22712d0 100644 (file)
@@ -1,37 +1,51 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.yangtools.sal.binding.model.api;\r
-\r
-import java.io.IOException;\r
-\r
-/**\r
- *\r
- *\r
- */\r
-public interface CodeGenerator {\r
-\r
-    /**\r
-     * @param type Input type to be processed\r
-     * @return generated code\r
-     * @throws IOException\r
-     */\r
-    String generate(Type type);\r
-\r
-    /**\r
-     * @param type Input type to be processed\r
-     * @return true if type is acceptable for processing.\r
-     */\r
-    boolean isAcceptable(Type type);\r
-\r
-    /**\r
-     * @param type Input type to be processed\r
-     * @return name of generated unit\r
-     */\r
-    String getUnitName(Type type);\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.sal.binding.model.api;
+
+import java.io.IOException;
+
+/**
+ * Transformates virtual data to the concrete code in programming language.
+ * 
+ */
+public interface CodeGenerator {
+
+    /**
+     * Generates code for <code>type</code>.
+     * 
+     * @param type
+     *            Input type to be processed
+     * @return generated JAVA code
+     * @throws IOException
+     */
+    String generate(Type type);
+
+    /**
+     * Checks if the concrete instance of <code>type</code> fit to concrete
+     * implementation of this interface.
+     * 
+     * (e. g. method return true if in <code>EnumGenerator</code> (which
+     * implements this interface) has input parameter of type Enumeration (which
+     * is subtype of Type)
+     * 
+     * @param type
+     *            Input type to be processed
+     * @return true if type is acceptable for processing.
+     */
+    boolean isAcceptable(Type type);
+
+    /**
+     * Returns name of <code>type</code> parameter.
+     * 
+     * @param type
+     *            Input type to be processed
+     * @return name of generated unit
+     */
+    String getUnitName(Type type);
+
+}