* 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.controller.yang.data.impl;\r
+package org.opendaylight.yangtools.yang.data.impl;\r
\r
import groovy.util.BuilderSupport;\r
\r
import java.util.Map;\r
import java.util.Map.Entry;\r
\r
-import org.opendaylight.controller.yang.common.QName;\r
-import org.opendaylight.controller.yang.data.api.CompositeNode;\r
-import org.opendaylight.controller.yang.data.api.ModifyAction;\r
-import org.opendaylight.controller.yang.data.api.MutableCompositeNode;\r
-import org.opendaylight.controller.yang.data.api.Node;\r
-import org.opendaylight.controller.yang.data.api.SimpleNode;\r
+import org.opendaylight.yangtools.yang.common.QName;\r
+import org.opendaylight.yangtools.yang.data.api.CompositeNode;\r
+import org.opendaylight.yangtools.yang.data.api.ModifyAction;\r
+import org.opendaylight.yangtools.yang.data.api.MutableCompositeNode;\r
+import org.opendaylight.yangtools.yang.data.api.Node;\r
+import org.opendaylight.yangtools.yang.data.api.SimpleNode;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
*\r
*/\r
public class MyNodeBuilder extends BuilderSupport {\r
- \r
+\r
private static final Logger LOG = LoggerFactory\r
.getLogger(MyNodeBuilder.class);\r
\r
private URI qnNamespace;\r
private String qnPrefix;\r
private Date qnRevision;\r
- \r
+\r
private CompositeNode rootNode;\r
\r
/**\r
QName qName = null;\r
try {\r
qName = new QName(\r
- new URI("urn:opendaylight:controller:network"), \r
+ new URI("urn:opendaylight:controller:network"),\r
new Date(42), "yang-data-impl-groovyTest_", null);\r
} catch (URISyntaxException e) {\r
LOG.error(e.getMessage(), e);\r
NodeUtils.fixParentRelation(newNode);\r
return newNode;\r
}\r
- \r
+\r
/**\r
* @param attributes\r
- * @return \r
+ * @return\r
*/\r
private ModifyAction processAttributes(@SuppressWarnings("rawtypes") Map attributes) {\r
LOG.debug("attributes:" + attributes);\r
ModifyAction modAction = null;\r
- \r
+\r
@SuppressWarnings("unchecked")\r
Map<String, String> attributesSane = attributes;\r
for (Entry<String, String> attr : attributesSane.entrySet()) {\r
case "modifyAction":\r
modAction = ModifyAction.valueOf(attr.getValue());\r
break;\r
- \r
+\r
default:\r
throw new IllegalArgumentException("Attribute not supported: "+attr.getKey());\r
}\r
if (getCurrent() != null) {\r
if (getCurrent() instanceof CompositeNode) {\r
return (CompositeNode) getCurrent();\r
- \r
+\r
} else {\r
throw new IllegalAccessError("current node is not of type CompositeNode, but: "\r
+getCurrent().getClass().getSimpleName());\r
}\r
}\r
- \r
+\r
return null;\r
}\r
- \r
+\r
@Override\r
protected Object postNodeCompletion(Object parent, Object node) {\r
Node<?> nodeRevisited = (Node<?>) node;\r
nodeRevisited.getParent().getChildren().remove(mutant);\r
}\r
}\r
- \r
- \r
+\r
+\r
return nodeRevisited;\r
}\r
- \r
+\r
/**\r
* @return tree root\r
*/\r