Fixed bugs in parsing enumeration, augment, identity.
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / yang / model / util / StringType.java
index c676d7479a16ce13205a1662b503c2080783974e..f58075bf307d9d6d2bd4f2012620dc4970426c7a 100644 (file)
@@ -7,8 +7,10 @@
   */
 package org.opendaylight.controller.yang.model.util;
 
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.List;
 
 import org.opendaylight.controller.yang.common.QName;
@@ -38,9 +40,10 @@ public class StringType implements StringTypeDefinition {
     /**
      * Default Constructor.
      */
-    public StringType() {
+    public StringType(final List<String> actualPath,
+            final URI namespace, final Date revision) {
         super();
-        path = BaseTypes.schemaPath(name);
+        path = BaseTypes.schemaPath(actualPath, namespace, revision);
         final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();
         constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
         lengthStatements = Collections.unmodifiableList(constraints);
@@ -54,10 +57,11 @@ public class StringType implements StringTypeDefinition {
      * @param lengthStatements
      * @param patterns
      */
-    public StringType(final List<LengthConstraint> lengthStatements,
+    public StringType(final List<String> actualPath,
+            final URI namespace, final Date revision, final List<LengthConstraint> lengthStatements,
             final List<PatternConstraint> patterns) {
         super();
-        path = BaseTypes.schemaPath(name);
+        path = BaseTypes.schemaPath(actualPath, namespace, revision);
         if(lengthStatements == null || lengthStatements.size() == 0) {
             final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();
             constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
@@ -76,11 +80,12 @@ public class StringType implements StringTypeDefinition {
      * @param patterns
      * @param units
      */
-    public StringType(final String defaultValue,
+    public StringType(final List<String> actualPath,
+            final URI namespace, final Date revision, final String defaultValue,
             final List<LengthConstraint> lengthStatements,
             final List<PatternConstraint> patterns, final String units) {
         super();
-        path = BaseTypes.schemaPath(name);
+        path = BaseTypes.schemaPath(actualPath, namespace, revision);
         this.defaultValue = defaultValue;
         if(lengthStatements == null || lengthStatements.size() == 0) {
             final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();