import org.opendaylight.controller.yang.model.util.RevisionAwareXPathImpl;
public class AugmentationSchemaBuilderImpl implements AugmentationSchemaBuilder {
-
private final AugmentationSchemaImpl instance;
+ private final int line;
private final String augmentTargetStr;
- private final SchemaPath augmentTarget;
+ private SchemaPath augmentTarget;
+ private SchemaPath finalAugmentTarget;
private String whenCondition;
private final Set<DataSchemaNodeBuilder> childNodes = new HashSet<DataSchemaNodeBuilder>();
private final Set<GroupingBuilder> groupings = new HashSet<GroupingBuilder>();
private final Set<UsesNodeBuilder> usesNodes = new HashSet<UsesNodeBuilder>();
+ private boolean resolved;
- AugmentationSchemaBuilderImpl(final String augmentTargetStr) {
+ AugmentationSchemaBuilderImpl(final String augmentTargetStr, final int line) {
this.augmentTargetStr = augmentTargetStr;
+ this.line = line;
final SchemaPath targetPath = YangModelBuilderUtil
.parseAugmentPath(augmentTargetStr);
augmentTarget = targetPath;
instance = new AugmentationSchemaImpl(targetPath);
}
+ @Override
+ public int getLine() {
+ return line;
+ }
+
@Override
public void addChildNode(DataSchemaNodeBuilder childNode) {
childNodes.add(childNode);
@Override
public AugmentationSchema build() {
+ instance.setTargetPath(finalAugmentTarget);
+
RevisionAwareXPath whenStmt;
if (whenCondition == null) {
whenStmt = null;
return instance;
}
+ @Override
+ public boolean isResolved() {
+ return resolved;
+ }
+
+ @Override
+ public void setResolved(boolean resolved) {
+ this.resolved = resolved;
+ }
+
public String getWhenCondition() {
return whenCondition;
}
return augmentTarget;
}
+ @Override
+ public void setTargetPath(SchemaPath path) {
+ this.finalAugmentTarget = path;
+ }
+
@Override
public String getTargetPathAsString() {
return augmentTargetStr;
private static class AugmentationSchemaImpl implements AugmentationSchema {
- private final SchemaPath targetPath;
+ private SchemaPath targetPath;
private RevisionAwareXPath whenCondition;
private Map<QName, DataSchemaNode> childNodes = Collections.emptyMap();
private Set<GroupingDefinition> groupings = Collections.emptySet();
return targetPath;
}
+ private void setTargetPath(SchemaPath path) {
+ this.targetPath = path;
+ }
+
@Override
public RevisionAwareXPath getWhenCondition() {
return whenCondition;