<artifactId>concepts</artifactId>\r
<version>0.1.1-SNAPSHOT</version>\r
</dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.yangtools</groupId>\r
+ <artifactId>yang-common</artifactId>\r
+ </dependency>\r
</dependencies>\r
</project>\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.yang.binding;
-
-public interface Augmentable<T> {
-
- <E extends Augmentation<T>> E getAugmentation(Class<E> augmentationType);
-}
+/*\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.yang.binding;\r
+\r
+/**\r
+ * Augmentable (extensible) object which could carry additional data defined by\r
+ * third-party extension, without introducing conflict between various\r
+ * extension.\r
+ * \r
+ * This interface uses extended version of ExtensibleInterface pattern which\r
+ * also adds marker interface for augmentations (extensions) -\r
+ * {@link Augmentable}\r
+ * \r
+ * @author Tony Tkacik <ttkacik@cisco.com>\r
+ * @param <T>\r
+ * Base class which should implements this interface and is target\r
+ * for augmentation.\r
+ */\r
+public interface Augmentable<T> {\r
+\r
+ /**\r
+ * Returns instance of augmentation.\r
+ * \r
+ * @param augmentationType\r
+ * Type of augmentation to be returned.\r
+ * @return instance of augmentation.\r
+ */\r
+ <E extends Augmentation<T>> E getAugmentation(Class<E> augmentationType);\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.yang.binding;
-
-public interface Augmentation<T> {
-
-}
+/*\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.yang.binding;\r
+\r
+/**\r
+ * Augmentation (extension) of other interface\r
+ *\r
+ * @param <T> Class to which this implementation is extension.\r
+ */\r
+public interface Augmentation<T> {\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.yang.binding;
-
-public abstract class BaseIdentity {
-
- protected BaseIdentity() {
- }
-
-}
+/*\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.yang.binding;\r
+\r
+/**\r
+ * Base Identity\r
+ * \r
+ */\r
+public abstract class BaseIdentity {\r
+\r
+ public final static BaseIdentity INSTANCE = new BaseIdentity() {\r
+ };\r
+\r
+ protected BaseIdentity() {\r
+\r
+ }\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.yang.binding;
-
-public interface DataObject {
-
-}
+/*\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.yang.binding;\r
+\r
+/**\r
+ * Data container is an interface which has structured contents.\r
+ * \r
+ * \r
+ * @author Tony Tkacik <ttkacik@cisco.com>\r
+ *\r
+ */\r
+public interface DataObject {\r
+\r
+}\r
*/\r
package org.opendaylight.yangtools.yang.binding;\r
\r
+/**\r
+ * Data Root of YANG module\r
+ * \r
+ */\r
public interface DataRoot {\r
\r
}\r
\r
\r
/**\r
- * Object is uniquely identifiable in its scope by key\r
- * \r
- * \r
+ * Identifiable object, which could be identified by it's key\r
* \r
* @author ttkacik\r
*\r
* \r
* Object is unique identifier for another object\r
* \r
- * @author ttkacik\r
+ *\r
*\r
* @param <T> Class of object for which this object is identifier\r
+ * @author ttkacik\r
*/\r
public interface Identifier<T extends Identifiable<?>> {\r
\r
\r
import org.opendaylight.yangtools.concepts.Builder;\r
import org.opendaylight.yangtools.concepts.Immutable;\r
-import org.opendaylight.yangtools.concepts.Mutable;\r
\r
/**\r
- * Uniquely identifies instance of data tree.\r
+ * Uniquely identifies data location in the overall of data tree \r
+ * modeled by YANG.\r
+ * \r
* \r
*/\r
public final class InstanceIdentifier implements Immutable {\r
}\r
\r
/**\r
- * Path argument of instance identifier.\r
- * \r
+ * Path argument of {@link InstanceIdentifier}.\r
+ * <p>\r
* Interface which implementations are used as path components of the\r
- * instance path.\r
- * \r
- * @author ttkacik\r
- * \r
+ * path in overall data tree.\r
+ *\r
*/\r
public interface PathArgument {\r
\r
return new BuilderImpl();\r
}\r
\r
- private static class BuilderImpl implements InstanceIdentifierBuilder {\r
+ public static InstanceIdentifierBuilder builder(InstanceIdentifier basePath) {\r
+ return new BuilderImpl(basePath.path);\r
+ }\r
+\r
+ private static final class BuilderImpl implements InstanceIdentifierBuilder {\r
\r
private List<PathArgument> path;\r
private Class<? extends DataObject> target = null;\r
\r
+ public BuilderImpl() {\r
+ this.path = new ArrayList<>();\r
+ }\r
+ \r
+\r
+ public BuilderImpl(List<? extends PathArgument> prefix) {\r
+ this.path = new ArrayList<>(prefix);\r
+ }\r
+\r
@Override\r
public InstanceIdentifier toInstance() {\r
List<PathArgument> immutablePath = Collections.unmodifiableList(new ArrayList<PathArgument>(path));\r
*/\r
package org.opendaylight.yangtools.yang.binding;\r
\r
+import java.util.EventListener;\r
+\r
/**\r
* Marker interface for generated notification listener interfaces\r
*\r
*/\r
-public interface NotificationListener {\r
+public interface NotificationListener extends EventListener {\r
\r
}\r
package org.opendaylight.yangtools.yang.binding.annotations;\r
\r
+import java.lang.annotation.Documented;\r
+import java.lang.annotation.ElementType;\r
import java.lang.annotation.Inherited;\r
+import java.lang.annotation.Retention;\r
+import java.lang.annotation.RetentionPolicy;\r
+import java.lang.annotation.Target;\r
\r
import org.opendaylight.yangtools.yang.binding.BaseIdentity;\r
\r
+\r
@Inherited\r
+@Documented\r
+@Target(ElementType.METHOD)\r
+@Retention(RetentionPolicy.RUNTIME)\r
public @interface RoutingContext {\r
\r
Class<? extends BaseIdentity> value();\r