import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import org.junit.Ignore;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.parser.util.RefineHolder;
import org.opendaylight.yangtools.yang.parser.util.RefineUtils;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
//Test for class RefineUtils
public class RefineTest {
testModels.add(listModelFile);
}
- private void findUnknownNode(DataSchemaNodeBuilder childNode, String unknownNodeValue, String unknownNodeName) {
+ private void findUnknownNode(final DataSchemaNodeBuilder childNode, final String unknownNodeValue, final String unknownNodeName) {
List<UnknownSchemaNodeBuilder> unknownSchemaNodesBuilder = childNode.getUnknownNodes();
boolean refinedUnknownNodeLflstFound = false;
refinedUnknownNodeLflstFound);
}
- private void findMustConstraint(ConstraintsBuilder conDef, String mustValue) {
+ private void findMustConstraint(final ConstraintsBuilder conDef, final String mustValue) {
boolean mustLflstFound = false;
for (MustDefinition mustDef : conDef.getMustDefinitions()) {
if (mustDef.toString().equals(mustValue)) {
return moduleBuilder;
}
- private void checkAnyXmlRefineHolderAndSchemaNodeBuilder(String string, List<RefineHolder> refineHolders,
- Set<DataSchemaNodeBuilder> dataSchemaNodeBuilders) {
+ private void checkAnyXmlRefineHolderAndSchemaNodeBuilder(final String string, final List<RefineHolder> refineHolders,
+ final Set<DataSchemaNodeBuilder> dataSchemaNodeBuilders) {
RefineHolder refHolderData = getRefineHolder("data", refineHolders);
QName qname = createQname();
}
- private void checkChc2RefineHolderAndSchemaNodeBuilder(String nodeName, List<RefineHolder> refineHolders,
- Set<DataSchemaNodeBuilder> dataSchemaNodeBuilders) {
+ private void checkChc2RefineHolderAndSchemaNodeBuilder(final String nodeName, final List<RefineHolder> refineHolders,
+ final Set<DataSchemaNodeBuilder> dataSchemaNodeBuilders) {
RefineHolder refHolderChc2 = getRefineHolder("chc2", refineHolders);
QName qname = createQname();
List<QName> path = Lists.newArrayList(qname);
- DataSchemaNodeBuilder builderChc2 = new ChoiceBuilder("module", 4, qname, new SchemaPath(path, true));
+ DataSchemaNodeBuilder builderChc2 = new ChoiceBuilder("module", 4, qname, SchemaPath.create(path, true));
assertNotNull("Refine holder chc2 wasn't initialized.", refHolderChc2);
RefineUtils.refineChoice((ChoiceBuilder) builderChc2, refHolderChc2);
assertFalse("'chc2' has incorrect value for 'mandatory'", conDefChc2.isMandatory());
}
- private void checkChcRefineHolderAndSchemaNodeBuilder(String nodeName, List<RefineHolder> refineHolders,
- Set<DataSchemaNodeBuilder> dataSchemaNodeBuilders) {
+ private void checkChcRefineHolderAndSchemaNodeBuilder(final String nodeName, final List<RefineHolder> refineHolders,
+ final Set<DataSchemaNodeBuilder> dataSchemaNodeBuilders) {
RefineHolder refHolderChc = getRefineHolder("chc", refineHolders);
QName qname = createQname();
List<QName> path = Lists.newArrayList(qname);
- DataSchemaNodeBuilder builderChc = new ChoiceBuilder("module", 4, qname, new SchemaPath(path, true));
+ DataSchemaNodeBuilder builderChc = new ChoiceBuilder("module", 4, qname, SchemaPath.create(path, true));
assertNotNull("Refine holder chc wasn't initialized.", refHolderChc);
assertNotNull("Data schema node builder chc wasn't initialized.", builderChc);
findUnknownNode(choiceBuilder, unknownNodeChcValue, unknownNodeChcName);
}
- private void checkLflstRefineHolderAndSchemaNodeBuilder(String nodeName, List<RefineHolder> refineHolders,
- Set<DataSchemaNodeBuilder> dataSchemaNodeBuilders) {
+ private void checkLflstRefineHolderAndSchemaNodeBuilder(final String nodeName, final List<RefineHolder> refineHolders,
+ final Set<DataSchemaNodeBuilder> dataSchemaNodeBuilders) {
RefineHolder refHolderLflst = getRefineHolder(nodeName, refineHolders);
QName qname = createQname();
}
- private RefineHolder getRefineHolder(String refHolderName, List<RefineHolder> refineHolders) {
+ private RefineHolder getRefineHolder(final String refHolderName, final List<RefineHolder> refineHolders) {
for (RefineHolder refineHolder : refineHolders) {
if (refineHolder.getName().equals(refHolderName)) {
return refineHolder;
return qname;
}
- private SchemaPath createSchemaPath(QName qname) {
+ private SchemaPath createSchemaPath(final QName qname) {
List<QName> qnames = new ArrayList<>();
qnames.add(createQname());
- return new SchemaPath(qnames, true);
+ return SchemaPath.create(qnames, true);
}
}
*/
package org.opendaylight.yangtools.yang.model.api;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.opendaylight.yangtools.yang.common.QName;
-
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
+import java.util.Arrays;
+import java.util.List;
+import org.opendaylight.yangtools.yang.common.QName;
/**
*
/**
* Shared instance of the conceptual root schema node.
*/
- public static final SchemaPath ROOT = SchemaPath.create(Collections.<QName>emptyList(), true);
+ public static final SchemaPath ROOT = new SchemaPath(ImmutableList.<QName> of(), true, null);
/**
* Shared instance of the "same" relative schema node.
*/
- public static final SchemaPath SAME = SchemaPath.create(Collections.<QName>emptyList(), false);
+ public static final SchemaPath SAME = new SchemaPath(ImmutableList.<QName> of(), false, null);
/**
* List of QName instances which represents complete path to the node.
public AbstractSignedInteger(final QName name, final String description, final Number minRange,
final Number maxRange, final String units) {
this.name = name;
- this.path = new SchemaPath(Collections.singletonList(name), true);
+ this.path = SchemaPath.create(Collections.singletonList(name), true);
this.description = description;
this.units = units;
this.rangeStatements = new ArrayList<RangeConstraint>();
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
*/
public AbstractUnsignedInteger(final QName name, final String description, final Number maxRange, final String units) {
this.name = name;
- this.path = new SchemaPath(Collections.singletonList(name), true);
+ this.path = SchemaPath.create(Collections.singletonList(name), true);
this.description = description;
this.units = units;
this.rangeStatements = new ArrayList<RangeConstraint>();
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
* @return Schema Path from Qname.
*/
public static SchemaPath schemaPath(final QName typeName) {
- List<QName> pathList = Collections.singletonList(typeName);
- return new SchemaPath(pathList, true);
+ return SchemaPath.create(Collections.singletonList(typeName), true);
}
/**
pathList.add(qname);
}
}
- return new SchemaPath(pathList, true);
+ return SchemaPath.create(pathList, true);
}
}
private static final BinaryType INSTANCE = new BinaryType();
private final QName name = BaseTypes.BINARY_QNAME;
- private final SchemaPath path = new SchemaPath(Collections.singletonList(name), true);
+ private final SchemaPath path = SchemaPath.create(Collections.singletonList(name), true);
private final List<Byte> bytes = Collections.emptyList();
private final List<LengthConstraint> lengthConstraints;
*/
public final class BooleanType implements BooleanTypeDefinition {
private static final BooleanType INSTANCE = new BooleanType();
- private static final SchemaPath PATH = new SchemaPath(Collections.singletonList(BaseTypes.BOOLEAN_QNAME), true);
+ private static final SchemaPath PATH = SchemaPath.create(Collections.singletonList(BaseTypes.BOOLEAN_QNAME), true);
private static final String DESCRIPTION = "The boolean built-in type represents a boolean value.";
private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.5";
private static final String UNITS = "";
public final class EmptyType implements EmptyTypeDefinition {
private static EmptyType instance;
private static final QName NAME = BaseTypes.constructQName("empty");
- private static final SchemaPath PATH = new SchemaPath(Collections.singletonList(NAME), true);
+ private static final SchemaPath PATH = SchemaPath.create(Collections.singletonList(NAME), true);
private static final String DESCRIPTION = "The empty built-in type represents a leaf that does not have any value, it conveys information by its presence or absence.";
private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#page-131";
List<QName> names = sp.getPath();
List<QName> newNames = new ArrayList<>(names);
newNames.remove(newNames.size() - 1);
- SchemaPath newSp = new SchemaPath(newNames, sp.isAbsolute());
+ SchemaPath newSp = SchemaPath.create(newNames, sp.isAbsolute());
parent = findDataSchemaNode(ctx, newSp);
do {
if (nodeNewNames.isEmpty()) {
parent = getParentModule((SchemaNode) parent, ctx);
} else {
- SchemaPath nodeNewSp = new SchemaPath(nodeNewNames, nodeSp.isAbsolute());
+ SchemaPath nodeNewSp = SchemaPath.create(nodeNewNames, nodeSp.isAbsolute());
parent = findDataSchemaNode(ctx, nodeNewSp);
}
} else {
List<QName> names = sp.getPath();
List<QName> newNames = new ArrayList<>(names);
newNames.remove(newNames.size() - 1);
- SchemaPath newSp = new SchemaPath(newNames, sp.isAbsolute());
+ SchemaPath newSp = SchemaPath.create(newNames, sp.isAbsolute());
parent = findDataSchemaNode(ctx, newSp);
if (parent instanceof AugmentationTarget) {
tmpPath.add(currentName);
public final class StringType implements StringTypeDefinition {
private static final StringType INSTANCE = new StringType();
private final QName name = BaseTypes.constructQName("string");
- private final SchemaPath path = new SchemaPath(Collections.singletonList(name), true);
+ private final SchemaPath path = SchemaPath.create(Collections.singletonList(name), true);
private static final String DEFAULT_VALUE = "";
private static final String DESCRIPTION = "";
private static final String REFERENCE = "";
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
for (QName name : parsedPath) {
newPath.add(new QName(mb.getNamespace(), mb.getRevision(), name.getPrefix(), name.getLocalName()));
}
- instance.targetPath = new SchemaPath(newPath, false);
+ instance.targetPath = SchemaPath.create(newPath, false);
} else {
instance.targetPath = targetNodeSchemaPath;
}
}
@Override
- public void setStatus(Status status) {
+ public void setStatus(final Status status) {
this.status = Preconditions.checkNotNull(status, "status cannot be null");
}
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
+
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
private String belongsTo;
private ModuleBuilder parent;
- public ModuleBuilder getParent() {
+ @Override
+ public ModuleBuilder getParent() {
return parent;
}
- public void setParent(ModuleBuilder parent) {
+ public void setParent(final ModuleBuilder parent) {
this.parent = parent;
}
super(name, 0, null);
this.name = name;
this.sourcePath = sourcePath;
- schemaPath = new SchemaPath(Collections.<QName> emptyList(), true);
+ schemaPath = SchemaPath.create(Collections.<QName> emptyList(), true);
this.submodule = submodule;
instance = new ModuleImpl(name, sourcePath);
actualPath.push(this);
}
- public ModuleBuilder(Module base) {
+ public ModuleBuilder(final Module base) {
super(base.getName(), 0, null);
this.name = base.getName();
this.sourcePath = base.getModuleSourcePath();
- schemaPath = new SchemaPath(Collections.<QName> emptyList(), true);
+ schemaPath = SchemaPath.create(Collections.<QName> emptyList(), true);
submodule = false;
instance = new ModuleImpl(base.getName(), base.getModuleSourcePath());
instance.setYangVersion(base.getYangVersion());
}
@Override
- public void setParent(Builder parent) {
+ public void setParent(final Builder parent) {
throw new YangParseException(name, 0, "Can not set parent to module");
}
return belongsTo;
}
- public void setBelongsTo(String belongsTo) {
+ public void setBelongsTo(final String belongsTo) {
this.belongsTo = belongsTo;
}
}
@Override
- public void addUsesNode(UsesNodeBuilder usesBuilder) {
+ public void addUsesNode(final UsesNodeBuilder usesBuilder) {
addedUsesNodes.add(usesBuilder);
allUsesNodes.add(usesBuilder);
}
return outputBuilder;
}
- public void addNotification(NotificationDefinition notification) {
+ public void addNotification(final NotificationDefinition notification) {
notifications.add(notification);
}
}
@Override
- public void addTypedef(TypeDefinitionBuilder typedefBuilder) {
+ public void addTypedef(final TypeDefinitionBuilder typedefBuilder) {
String nodeName = typedefBuilder.getQName().getLocalName();
for (TypeDefinitionBuilder tdb : addedTypedefs) {
if (tdb.getQName().getLocalName().equals(nodeName)) {
return "module " + name;
}
- public void setSource(String source) {
+ public void setSource(final String source) {
this.source = source;
}
private final List<UnknownSchemaNode> unknownNodes = new ArrayList<>();
private String source;
- private ModuleImpl(String name, String sourcePath) {
+ private ModuleImpl(final String name, final String sourcePath) {
this.name = name;
this.sourcePath = sourcePath;
}
return namespace;
}
- private void setNamespace(URI namespace) {
+ private void setNamespace(final URI namespace) {
this.namespace = namespace;
}
return revision;
}
- private void setRevision(Date revision) {
+ private void setRevision(final Date revision) {
this.revision = revision;
}
return prefix;
}
- private void setPrefix(String prefix) {
+ private void setPrefix(final String prefix) {
this.prefix = prefix;
}
return yangVersion;
}
- private void setYangVersion(String yangVersion) {
+ private void setYangVersion(final String yangVersion) {
this.yangVersion = yangVersion;
}
return description;
}
- private void setDescription(String description) {
+ private void setDescription(final String description) {
this.description = description;
}
return reference;
}
- private void setReference(String reference) {
+ private void setReference(final String reference) {
this.reference = reference;
}
return organization;
}
- private void setOrganization(String organization) {
+ private void setOrganization(final String organization) {
this.organization = organization;
}
return contact;
}
- private void setContact(String contact) {
+ private void setContact(final String contact) {
this.contact = contact;
}
return imports;
}
- private void setImports(Set<ModuleImport> imports) {
+ private void setImports(final Set<ModuleImport> imports) {
if (imports != null) {
this.imports.addAll(imports);
}
return features;
}
- private void setFeatures(Set<FeatureDefinition> features) {
+ private void setFeatures(final Set<FeatureDefinition> features) {
if (features != null) {
this.features.addAll(features);
}
return typeDefinitions;
}
- private void setTypeDefinitions(Set<TypeDefinition<?>> typeDefinitions) {
+ private void setTypeDefinitions(final Set<TypeDefinition<?>> typeDefinitions) {
if (typeDefinitions != null) {
this.typeDefinitions.addAll(typeDefinitions);
}
return notifications;
}
- private void setNotifications(Set<NotificationDefinition> notifications) {
+ private void setNotifications(final Set<NotificationDefinition> notifications) {
if (notifications != null) {
this.notifications.addAll(notifications);
}
return augmentations;
}
- private void setAugmentations(Set<AugmentationSchema> augmentations) {
+ private void setAugmentations(final Set<AugmentationSchema> augmentations) {
if (augmentations != null) {
this.augmentations.addAll(augmentations);
}
return rpcs;
}
- private void setRpcs(Set<RpcDefinition> rpcs) {
+ private void setRpcs(final Set<RpcDefinition> rpcs) {
if (rpcs != null) {
this.rpcs.addAll(rpcs);
}
return deviations;
}
- private void setDeviations(Set<Deviation> deviations) {
+ private void setDeviations(final Set<Deviation> deviations) {
if (deviations != null) {
this.deviations.addAll(deviations);
}
return Collections.unmodifiableSet(childNodes);
}
- private void addChildNodes(Set<DataSchemaNode> childNodes) {
+ private void addChildNodes(final Set<DataSchemaNode> childNodes) {
if (childNodes != null) {
this.childNodes.addAll(childNodes);
}
return groupings;
}
- private void setGroupings(Set<GroupingDefinition> groupings) {
+ private void setGroupings(final Set<GroupingDefinition> groupings) {
if (groupings != null) {
this.groupings.addAll(groupings);
}
return uses;
}
- private void setUses(Set<UsesNode> uses) {
+ private void setUses(final Set<UsesNode> uses) {
if (uses != null) {
this.uses.addAll(uses);
}
}
@Override
- public DataSchemaNode getDataChildByName(QName name) {
+ public DataSchemaNode getDataChildByName(final QName name) {
return getChildNode(childNodes, name);
}
@Override
- public DataSchemaNode getDataChildByName(String name) {
+ public DataSchemaNode getDataChildByName(final String name) {
return getChildNode(childNodes, name);
}
- void setSource(String source){
+ void setSource(final String source){
this.source = source;
}
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
newPath.add(new QName(ns, rev, localPrefix, qn.getLocalName()));
}
}
- augment.setTargetNodeSchemaPath(new SchemaPath(newPath, true));
+ augment.setTargetNodeSchemaPath(SchemaPath.create(newPath, true));
for (DataSchemaNodeBuilder childNode : augment.getChildNodeBuilders()) {
correctPathForAugmentNodes(childNode, augment.getTargetNodeSchemaPath());
* schema path of parent node
*/
private void correctPathForAugmentNodes(final DataSchemaNodeBuilder node, final SchemaPath parentPath) {
- SchemaPath newPath = ParserUtils.createSchemaPath(parentPath, node.getQName());
+ SchemaPath newPath = parentPath.createChild(node.getQName());
node.setPath(newPath);
if (node instanceof DataNodeContainerBuilder) {
for (DataSchemaNodeBuilder child : ((DataNodeContainerBuilder) node).getChildNodeBuilders()) {
}
}
- SchemaPath newSchemaPath = new SchemaPath(newPath, true);
+ SchemaPath newSchemaPath = SchemaPath.create(newPath, true);
return new DataBean(newQName, newSchemaPath);
}
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.TerminalNode;
-import org.opendaylight.yangtools.antlrv4.code.gen.*;
+import org.opendaylight.yangtools.antlrv4.code.gen.YangParser;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.Argument_stmtContext;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.Base_stmtContext;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.Bit_stmtContext;
return result;
}
- public static String stringFromStringContext(StringContext context) {
+ public static String stringFromStringContext(final StringContext context) {
StringBuilder str = new StringBuilder();
for (TerminalNode stringNode : context.STRING()) {
String result = stringNode.getText();
* @return SchemaPath object
*/
public static SchemaPath createActualSchemaPath(final Stack<QName> actualPath) {
- final List<QName> path = new ArrayList<>(actualPath);
- return new SchemaPath(path, true);
+ return SchemaPath.create(actualPath, true);
}
/**
private String description;
private String reference;
private Status status;
- private List<UnknownSchemaNode> unknownNodes = Collections.emptyList();
+ private final List<UnknownSchemaNode> unknownNodes = Collections.emptyList();
private String name;
private Integer value;
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
* @return 'fraction-digits' value if present in given context, null
* otherwise
*/
- private static Integer getFractionDigits(Type_body_stmtsContext ctx, String moduleName) {
+ private static Integer getFractionDigits(final Type_body_stmtsContext ctx, final String moduleName) {
Integer result = null;
for (int i = 0; i < ctx.getChildCount(); i++) {
ParseTree dec64specChild = ctx.getChild(i);
* name of current module
* @return fraction-digits value as Integer
*/
- private static Integer parseFractionDigits(Decimal64_specificationContext ctx, String moduleName) {
+ private static Integer parseFractionDigits(final Decimal64_specificationContext ctx, final String moduleName) {
Integer result = null;
for (int i = 0; i < ctx.getChildCount(); i++) {
ParseTree fdChild = ctx.getChild(i);
* current module name
* @return List of Bit objects created from this context
*/
- private static List<BitsTypeDefinition.Bit> getBits(Type_body_stmtsContext ctx, Stack<QName> actualPath,
- String moduleName) {
+ private static List<BitsTypeDefinition.Bit> getBits(final Type_body_stmtsContext ctx, final Stack<QName> actualPath,
+ final String moduleName) {
final List<BitsTypeDefinition.Bit> bits = new ArrayList<>();
for (int j = 0; j < ctx.getChildCount(); j++) {
ParseTree bitsSpecChild = ctx.getChild(j);
* current module name
* @return Bit object parsed from this context
*/
- private static BitsTypeDefinition.Bit parseBit(final Bit_stmtContext ctx, long highestPosition,
- Stack<QName> actualPath, final String moduleName) {
+ private static BitsTypeDefinition.Bit parseBit(final Bit_stmtContext ctx, final long highestPosition,
+ final Stack<QName> actualPath, final String moduleName) {
String name = stringFromNode(ctx);
Long position = null;
* Ordered_by_stmtContext
* @return true, if ordered-by contains value 'user', false otherwise
*/
- public static boolean parseUserOrdered(Ordered_by_stmtContext ctx) {
+ public static boolean parseUserOrdered(final Ordered_by_stmtContext ctx) {
boolean result = false;
for (int j = 0; j < ctx.getChildCount(); j++) {
ParseTree orderArg = ctx.getChild(j);
return result;
}
- private static boolean getParentConfig(Builder node) {
+ private static boolean getParentConfig(final Builder node) {
Builder parent = node.getParent();
boolean config = false;
List<QName> path = new ArrayList<>(actualPath);
path.add(new QName(namespace, revision, prefix, typeName));
- SchemaPath schemaPath = new SchemaPath(path, true);
+ SchemaPath schemaPath = SchemaPath.create(path, true);
QName qname = schemaPath.getPath().get(schemaPath.getPath().size() - 1);
ExtendedType.Builder typeBuilder = new ExtendedType.Builder(qname, baseType, "", "", schemaPath);
return typeBuilder.build();
}
- private static SchemaPath createTypePath(Stack<QName> actual, String typeName) {
+ private static SchemaPath createTypePath(final Stack<QName> actual, final String typeName) {
QName last = actual.peek();
QName typeQName = new QName(last.getNamespace(), last.getRevision(), last.getPrefix(), typeName);
List<QName> path = new ArrayList<>(actual);
path.add(typeQName);
- return new SchemaPath(path, true);
+ return SchemaPath.create(path, true);
}
- private static SchemaPath createBaseTypePath(Stack<QName> actual, String typeName) {
+ private static SchemaPath createBaseTypePath(final Stack<QName> actual, final String typeName) {
List<QName> path = new ArrayList<>(actual);
path.add(BaseTypes.constructQName(typeName));
- return new SchemaPath(path, true);
+ return SchemaPath.create(path, true);
}
- private static SchemaPath createExtendedBaseTypePath(Stack<QName> actual, URI namespace, Date revision,
- String prefix, String typeName) {
+ private static SchemaPath createExtendedBaseTypePath(final Stack<QName> actual, final URI namespace, final Date revision,
+ final String prefix, final String typeName) {
QName extTypeName = new QName(namespace, revision, prefix, typeName);
QName baseTypeName = BaseTypes.constructQName(typeName);
List<QName> path = new ArrayList<>(actual);
path.add(extTypeName);
path.add(baseTypeName);
- return new SchemaPath(path, true);
+ return SchemaPath.create(path, true);
}
/**
* type body
* @return identityref base value as String
*/
- public static String getIdentityrefBase(Type_body_stmtsContext ctx) {
+ public static String getIdentityrefBase(final Type_body_stmtsContext ctx) {
String result = null;
outer: for (int i = 0; i < ctx.getChildCount(); i++) {
ParseTree child = ctx.getChild(i);
* type body context
* @return require-instance value
*/
- private static boolean isRequireInstance(Type_body_stmtsContext ctx) {
+ private static boolean isRequireInstance(final Type_body_stmtsContext ctx) {
for (int i = 0; i < ctx.getChildCount(); i++) {
ParseTree child = ctx.getChild(i);
if (child instanceof Instance_identifier_specificationContext) {
* type body context
* @return leafref path as String
*/
- private static String parseLeafrefPath(Type_body_stmtsContext ctx) {
+ private static String parseLeafrefPath(final Type_body_stmtsContext ctx) {
for (int i = 0; i < ctx.getChildCount(); i++) {
ParseTree child = ctx.getChild(i);
if (child instanceof Leafref_specificationContext) {
}
}
- private static Integer parseMinElements(Min_elements_stmtContext ctx, String moduleName) {
+ private static Integer parseMinElements(final Min_elements_stmtContext ctx, final String moduleName) {
Integer result = null;
try {
for (int i = 0; i < ctx.getChildCount(); i++) {
}
}
- private static Integer parseMaxElements(Max_elements_stmtContext ctx, String moduleName) {
+ private static Integer parseMaxElements(final Max_elements_stmtContext ctx, final String moduleName) {
Integer result = null;
try {
for (int i = 0; i < ctx.getChildCount(); i++) {
* context to parse
* @return true if value is 'true', false otherwise
*/
- public static boolean parseYinValue(Argument_stmtContext ctx) {
+ public static boolean parseYinValue(final Argument_stmtContext ctx) {
boolean yinValue = false;
outer: for (int i = 0; i < ctx.getChildCount(); i++) {
ParseTree yin = ctx.getChild(i);
* name of current module
* @return RefineHolder object representing this refine statement
*/
- public static RefineHolder parseRefine(Refine_stmtContext refineCtx, String moduleName) {
+ public static RefineHolder parseRefine(final Refine_stmtContext refineCtx, final String moduleName) {
final String refineTarget = stringFromNode(refineCtx);
final RefineHolder refine = new RefineHolder(moduleName, refineCtx.getStart().getLine(), refineTarget);
for (int i = 0; i < refineCtx.getChildCount(); i++) {
return refine;
}
- private static void parseRefineDefault(RefineHolder refine, ParseTree refineStmt) {
+ private static void parseRefineDefault(final RefineHolder refine, final ParseTree refineStmt) {
for (int i = 0; i < refineStmt.getChildCount(); i++) {
ParseTree refineArg = refineStmt.getChild(i);
if (refineArg instanceof Description_stmtContext) {
}
}
- private static RefineHolder parseRefine(RefineHolder refine, Refine_leaf_stmtsContext refineStmt) {
+ private static RefineHolder parseRefine(final RefineHolder refine, final Refine_leaf_stmtsContext refineStmt) {
for (int i = 0; i < refineStmt.getChildCount(); i++) {
ParseTree refineArg = refineStmt.getChild(i);
if (refineArg instanceof Default_stmtContext) {
return refine;
}
- private static RefineHolder parseRefine(RefineHolder refine, Refine_container_stmtsContext refineStmt) {
+ private static RefineHolder parseRefine(final RefineHolder refine, final Refine_container_stmtsContext refineStmt) {
for (int i = 0; i < refineStmt.getChildCount(); i++) {
ParseTree refineArg = refineStmt.getChild(i);
if (refineArg instanceof Must_stmtContext) {
return refine;
}
- private static RefineHolder parseRefine(RefineHolder refine, Refine_list_stmtsContext refineStmt) {
+ private static RefineHolder parseRefine(final RefineHolder refine, final Refine_list_stmtsContext refineStmt) {
for (int i = 0; i < refineStmt.getChildCount(); i++) {
ParseTree refineArg = refineStmt.getChild(i);
if (refineArg instanceof Must_stmtContext) {
return refine;
}
- private static RefineHolder parseRefine(RefineHolder refine, Refine_leaf_list_stmtsContext refineStmt) {
+ private static RefineHolder parseRefine(final RefineHolder refine, final Refine_leaf_list_stmtsContext refineStmt) {
for (int i = 0; i < refineStmt.getChildCount(); i++) {
ParseTree refineArg = refineStmt.getChild(i);
if (refineArg instanceof Must_stmtContext) {
return refine;
}
- private static RefineHolder parseRefine(RefineHolder refine, Refine_choice_stmtsContext refineStmt) {
+ private static RefineHolder parseRefine(final RefineHolder refine, final Refine_choice_stmtsContext refineStmt) {
for (int i = 0; i < refineStmt.getChildCount(); i++) {
ParseTree refineArg = refineStmt.getChild(i);
if (refineArg instanceof Default_stmtContext) {
return refine;
}
- private static RefineHolder parseRefine(RefineHolder refine, Refine_anyxml_stmtsContext refineStmt) {
+ private static RefineHolder parseRefine(final RefineHolder refine, final Refine_anyxml_stmtsContext refineStmt) {
for (int i = 0; i < refineStmt.getChildCount(); i++) {
ParseTree refineArg = refineStmt.getChild(i);
if (refineArg instanceof Must_stmtContext) {
return refine;
}
- public static String getArgumentString(org.antlr.v4.runtime.ParserRuleContext ctx) {
+ public static String getArgumentString(final org.antlr.v4.runtime.ParserRuleContext ctx) {
List<StringContext> potentialValues = ctx.getRuleContexts(StringContext.class);
checkState(!potentialValues.isEmpty());
return ParserListenerUtils.stringFromStringContext(potentialValues.get(0));
}
- public static <T extends ParserRuleContext> Optional<T> getFirstContext(ParserRuleContext context,Class<T> contextType) {
+ public static <T extends ParserRuleContext> Optional<T> getFirstContext(final ParserRuleContext context,final Class<T> contextType) {
List<T> potential = context.getRuleContexts(contextType);
if(potential.isEmpty()) {
return Optional.absent();
* @param qname
* one or more qnames added to base path
* @return new SchemaPath from given path and qname
+ *
+ * @deprecated Use {@link SchemaPath#createChild(QName...)} instead.
*/
+ @Deprecated
public static SchemaPath createSchemaPath(final SchemaPath schemaPath, final QName... qname) {
List<QName> path = new ArrayList<>(schemaPath.getPath());
path.addAll(Arrays.asList(qname));
- return new SchemaPath(path, schemaPath.isAbsolute());
+ return SchemaPath.create(path, schemaPath.isAbsolute());
}
/**
path.add(name);
}
}
- return new SchemaPath(path, absolute);
+ return SchemaPath.create(path, absolute);
}
/**
public static DataSchemaNodeBuilder wrapChildNode(final String moduleName, final int line, final DataSchemaNode node,
final SchemaPath parentPath, final QName qname) {
- List<QName> path = new ArrayList<>(parentPath.getPath());
- path.add(qname);
- SchemaPath schemaPath = new SchemaPath(path, parentPath.isAbsolute());
+
+ final SchemaPath schemaPath = parentPath.createChild(qname);
if (node instanceof AnyXmlSchemaNode) {
return new AnyXmlBuilder(moduleName, line, qname, schemaPath, ((AnyXmlSchemaNode) node));
Set<GroupingBuilder> result = new HashSet<>();
for (GroupingDefinition node : nodes) {
QName qname = new QName(ns, rev, pref, node.getQName().getLocalName());
- List<QName> path = new ArrayList<>(parentPath.getPath());
- path.add(qname);
- SchemaPath schemaPath = new SchemaPath(path, parentPath.isAbsolute());
+ SchemaPath schemaPath = parentPath.createChild(qname);
result.add(new GroupingBuilderImpl(moduleName, line, qname, schemaPath, node));
}
return result;
QName qname = new QName(ns, rev, pref, node.getQName().getLocalName());
List<QName> path = new ArrayList<>(parentPath.getPath());
path.add(qname);
- SchemaPath schemaPath = new SchemaPath(path, parentPath.isAbsolute());
+ SchemaPath schemaPath = SchemaPath.create(path, parentPath.isAbsolute());
result.add(new TypeDefinitionBuilderImpl(moduleName, line, qname, schemaPath, ((ExtendedType) node)));
}
return result;
QName qname = new QName(ns, rev, pref, node.getQName().getLocalName());
List<QName> path = new ArrayList<>(parentPath.getPath());
path.add(qname);
- SchemaPath schemaPath = new SchemaPath(path, parentPath.isAbsolute());
+ SchemaPath schemaPath = SchemaPath.create(path, parentPath.isAbsolute());
result.add(new UnknownSchemaNodeBuilder(moduleName, line, qname, schemaPath, node));
}
return result;
*/
package org.opendaylight.yangtools.yang.parser.impl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.io.FileNotFoundException;
import java.net.URI;
AugmentationSchema augment = augmentations.iterator().next();
assertNotNull(augment);
- expectedSchemaPath = new SchemaPath(qnames, true);
+ expectedSchemaPath = SchemaPath.create(qnames, true);
assertEquals(expectedSchemaPath, augment.getTargetPath());
Set<DataSchemaNode> augmentChildren = augment.getChildNodes();
QName qname = new QName(fooNS, fooRev, foo, "ds0ChannelNumber");
qnames.add(qname);
assertEquals(qname, ds0ChannelNumber.getQName());
- expectedSchemaPath = new SchemaPath(qnames, true);
+ expectedSchemaPath = SchemaPath.create(qnames, true);
assertEquals(expectedSchemaPath, ds0ChannelNumber.getPath());
assertFalse(ds0ChannelNumber.isAugmenting());
// type of leaf ds0ChannelNumber
QName typeQName = BaseTypes.constructQName("string");
List<QName> typePath = Collections.singletonList(typeQName);
- expectedSchemaPath = new SchemaPath(typePath, true);
+ expectedSchemaPath = SchemaPath.create(typePath, true);
assertEquals(expectedSchemaPath, ds0ChannelNumber.getType().getPath());
// leaf interface-id
qname = new QName(fooNS, fooRev, foo, "interface-id");
assertEquals(qname, interfaceId.getQName());
qnames.set(3, qname);
- expectedSchemaPath = new SchemaPath(qnames, true);
+ expectedSchemaPath = SchemaPath.create(qnames, true);
assertEquals(expectedSchemaPath, interfaceId.getPath());
assertFalse(interfaceId.isAugmenting());
qname = new QName(fooNS, fooRev, foo, "schemas");
assertEquals(qname, schemas.getQName());
qnames.set(3, qname);
- expectedSchemaPath = new SchemaPath(qnames, true);
+ expectedSchemaPath = SchemaPath.create(qnames, true);
assertEquals(expectedSchemaPath, schemas.getPath());
assertFalse(schemas.isAugmenting());
qname = new QName(fooNS, fooRev, foo, "odl");
assertEquals(qname, odl.getQName());
qnames.set(3, qname);
- expectedSchemaPath = new SchemaPath(qnames, true);
+ expectedSchemaPath = SchemaPath.create(qnames, true);
assertEquals(expectedSchemaPath, odl.getPath());
assertFalse(odl.isAugmenting());
ContainerSchemaNode augmentHolder = (ContainerSchemaNode) ifEntry.getDataChildByName("augment-holder");
TestUtils.checkIsAugmenting(augmentHolder, true);
assertEquals(q2, augmentHolder.getQName());
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, augmentHolder.getPath());
// foo.yang
QName qname = new QName(fooNS, fooRev, foo, "ds0ChannelNumber");
assertEquals(qname, ds0ChannelNumber.getQName());
qnames.add(qname);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, ds0ChannelNumber.getPath());
// leaf interface-id
qname = new QName(fooNS, fooRev, foo, "interface-id");
assertEquals(qname, interfaceId.getQName());
qnames.set(3, qname);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, interfaceId.getPath());
// container schemas
qname = new QName(fooNS, fooRev, foo, "schemas");
assertEquals(qname, schemas.getQName());
qnames.set(3, qname);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, schemas.getPath());
// choice odl
qname = new QName(fooNS, fooRev, foo, "odl");
assertEquals(qname, odl.getQName());
qnames.set(3, qname);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, odl.getPath());
}
QName qname = new QName(fooNS, fooRev, foo, "id");
assertEquals(qname, id.getQName());
qnames.add(qname);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, id.getPath());
Set<DataSchemaNode> idChildren = id.getChildNodes();
assertEquals(1, idChildren.size());
qname = new QName(fooNS, fooRev, foo, "node1");
assertEquals(qname, node1.getQName());
qnames.set(4, qname);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, node1.getPath());
Set<DataSchemaNode> node1Children = node1.getChildNodes();
assertTrue(node1Children.isEmpty());
qname = new QName(fooNS, fooRev, foo, "node2");
assertEquals(qname, node2.getQName());
qnames.set(4, qname);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, node2.getPath());
Set<DataSchemaNode> node2Children = node2.getChildNodes();
assertTrue(node2Children.isEmpty());
qname = new QName(fooNS, fooRev, foo, "node3");
assertEquals(qname, node3.getQName());
qnames.set(4, qname);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, node3.getPath());
Set<DataSchemaNode> node3Children = node3.getChildNodes();
assertEquals(1, node3Children.size());
qnames.add(new QName(fooNS, fooRev, foo, "id"));
LeafSchemaNode caseIdChild = (LeafSchemaNode) idChildren.iterator().next();
assertNotNull(caseIdChild);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, caseIdChild.getPath());
// case node3 child
qnames.set(5, new QName(fooNS, fooRev, foo, "node3"));
ContainerSchemaNode caseNode3Child = (ContainerSchemaNode) node3Children.iterator().next();
assertNotNull(caseNode3Child);
- expectedPath = new SchemaPath(qnames, true);
+ expectedPath = SchemaPath.create(qnames, true);
assertEquals(expectedPath, caseNode3Child.getPath());
}
// case attach
qnames[3] = new QName(NS_FOO, revision, "f", "attach");
assertEquals(qnames[3], attach.getQName());
- expectedPath = new SchemaPath(Arrays.asList(qnames), true);
+ expectedPath = SchemaPath.create(Arrays.asList(qnames), true);
assertEquals(expectedPath, attach.getPath());
Set<DataSchemaNode> attachChildren = attach.getChildNodes();
assertEquals(1, attachChildren.size());
// case create
qnames[3] = new QName(NS_FOO, revision, "f", "create");
assertEquals(qnames[3], create.getQName());
- expectedPath = new SchemaPath(Arrays.asList(qnames), true);
+ expectedPath = SchemaPath.create(Arrays.asList(qnames), true);
assertEquals(expectedPath, create.getPath());
Set<DataSchemaNode> createChildren = create.getChildNodes();
assertEquals(1, createChildren.size());
// case attach
qnames[3] = new QName(NS_FOO, revision, "f", "destroy");
assertEquals(qnames[3], destroy.getQName());
- expectedPath = new SchemaPath(Arrays.asList(qnames), true);
+ expectedPath = SchemaPath.create(Arrays.asList(qnames), true);
assertEquals(expectedPath, destroy.getPath());
Set<DataSchemaNode> destroyChildren = destroy.getChildNodes();
assertEquals(1, destroyChildren.size());
import static org.junit.Assert.assertEquals;
-import java.io.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
-import java.text.*;
-import java.util.*;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.*;
+import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
+import org.opendaylight.yangtools.yang.model.api.ChoiceNode;
+import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
+import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
+import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.api.ModuleImport;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
final class TestUtils {
}
- public static Set<Module> loadModules(URI resourceDirectory) throws FileNotFoundException {
+ public static Set<Module> loadModules(final URI resourceDirectory) throws FileNotFoundException {
final YangModelParser parser = new YangParserImpl();
final File testDir = new File(resourceDirectory);
final String[] fileList = testDir.list();
return parser.parseYangModels(testFiles);
}
- public static Set<Module> loadModules(List<InputStream> input) throws IOException {
+ public static Set<Module> loadModules(final List<InputStream> input) throws IOException {
final YangModelParser parser = new YangParserImpl();
final Set<Module> modules = new HashSet<>(parser.parseYangModelsFromStreams(input));
for (InputStream stream : input) {
return modules;
}
- public static Module findModule(Set<Module> modules, String moduleName) {
+ public static Module findModule(final Set<Module> modules, final String moduleName) {
Module result = null;
for (Module module : modules) {
if (module.getName().equals(moduleName)) {
return result;
}
- public static ModuleImport findImport(Set<ModuleImport> imports, String prefix) {
+ public static ModuleImport findImport(final Set<ModuleImport> imports, final String prefix) {
ModuleImport result = null;
for (ModuleImport moduleImport : imports) {
if (moduleImport.getPrefix().equals(prefix)) {
return result;
}
- public static TypeDefinition<?> findTypedef(Set<TypeDefinition<?>> typedefs, String name) {
+ public static TypeDefinition<?> findTypedef(final Set<TypeDefinition<?>> typedefs, final String name) {
TypeDefinition<?> result = null;
for (TypeDefinition<?> td : typedefs) {
if (td.getQName().getLocalName().equals(name)) {
return result;
}
- public static SchemaPath createPath(boolean absolute, URI namespace, Date revision, String prefix, String... names) {
+ public static SchemaPath createPath(final boolean absolute, final URI namespace, final Date revision, final String prefix, final String... names) {
List<QName> path = new ArrayList<>();
for (String name : names) {
path.add(new QName(namespace, revision, prefix, name));
}
- return new SchemaPath(path, absolute);
+ return SchemaPath.create(path, absolute);
}
- public static Date createDate(String date) {
+ public static Date createDate(final String date) {
Date result;
final DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
* @param expected
* expected value
*/
- public static void checkIsAugmenting(DataSchemaNode node, boolean expected) {
+ public static void checkIsAugmenting(final DataSchemaNode node, final boolean expected) {
assertEquals(expected, node.isAugmenting());
if (node instanceof DataNodeContainer) {
for (DataSchemaNode child : ((DataNodeContainer) node).getChildNodes()) {
* @param expected
* expected value
*/
- public static void checkIsAddedByUses(DataSchemaNode node, boolean expected) {
+ public static void checkIsAddedByUses(final DataSchemaNode node, final boolean expected) {
assertEquals(expected, node.isAddedByUses());
if (node instanceof DataNodeContainer) {
for (DataSchemaNode child : ((DataNodeContainer) node).getChildNodes()) {
}
}
- public static void checkIsAddedByUses(GroupingDefinition node, boolean expected) {
+ public static void checkIsAddedByUses(final GroupingDefinition node, final boolean expected) {
assertEquals(expected, node.isAddedByUses());
if (node instanceof DataNodeContainer) {
for (DataSchemaNode child : ((DataNodeContainer) node).getChildNodes()) {
}
}
- public static List<Module> findModules(Set<Module> modules, String moduleName) {
+ public static List<Module> findModules(final Set<Module> modules, final String moduleName) {
List<Module> result = new ArrayList<>();
for (Module module : modules) {
if (module.getName().equals(moduleName)) {
*/
package org.opendaylight.yangtools.yang.parser.impl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.io.FileNotFoundException;
import java.net.URI;
assertNotNull(pcreq);
QName expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "pcreq");
path.offer(expectedQName);
- SchemaPath expectedPath = new SchemaPath(path, true);
+ SchemaPath expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, pcreq.getPath());
Set<DataSchemaNode> childNodes = pcreq.getChildNodes();
assertEquals(4, childNodes.size());
assertNotNull(version);
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "version");
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, version.getPath());
expectedQName = new QName(GD_NS, GD_REV, GD_PREF, "protocol-version");
path.offer(expectedQName);
- expectedPath = new SchemaPath(Lists.newArrayList(expectedQName), true);
+ expectedPath = SchemaPath.create(Lists.newArrayList(expectedQName), true);
assertEquals(expectedPath, version.getType().getPath());
assertEquals(Uint8.getInstance(), version.getType().getBaseType());
assertTrue(version.isAddedByUses());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, type.getPath());
expectedQName = new QName(GD_NS, GD_REV, GD_PREF, "int-ext");
path.offer(expectedQName);
- expectedPath = new SchemaPath(Lists.newArrayList(expectedQName), true);
+ expectedPath = SchemaPath.create(Lists.newArrayList(expectedQName), true);
assertEquals(expectedPath, type.getType().getPath());
UnionType union = (UnionType)type.getType().getBaseType();
assertEquals(BaseTypes.schemaPath(BaseTypes.constructQName("union")), union.getPath());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, requests.getPath());
assertFalse(requests.isAddedByUses());
childNodes = requests.getChildNodes();
assertNotNull(rp);
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "rp");
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, rp.getPath());
assertFalse(rp.isAddedByUses());
childNodes = rp.getChildNodes();
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, priority.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, priority.getPath());
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "uint8");
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
// TODO
//assertEquals(expectedPath, priority.getType().getPath());
assertEquals(Uint8.getInstance(), priority.getType().getBaseType());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, box.getPath());
assertTrue(box.isAddedByUses());
// * |-- |-- |-- |-- container order
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "order");
assertEquals(expectedQName, order.getQName());
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, order.getPath());
assertTrue(order.isAddedByUses());
assertTrue(order.isAugmenting());
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "delete");
assertEquals(expectedQName, delete.getQName());
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, delete.getPath());
assertEquals(Uint32.getInstance(), delete.getType());
assertTrue(delete.isAddedByUses());
assertEquals(expectedQName, setup.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, setup.getPath());
assertEquals(Uint32.getInstance(), setup.getType());
assertTrue(setup.isAddedByUses());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath = new SchemaPath(path, true);
+ expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, pke.getPath());
assertFalse(pke.isAddedByUses());
// * |-- |-- |-- path-key
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "path-key");
assertEquals(expectedQName, pathKey.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, pathKey.getPath());
assertFalse(pathKey.isAddedByUses());
assertEquals(3, pathKey.getChildNodes().size());
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, pathKeys.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, pathKeys.getPath());
assertTrue(pathKeys.isAddedByUses());
childNodes = pathKeys.getChildNodes();
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "version");
assertEquals(expectedQName, version.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, version.getPath());
assertTrue(version.getType() instanceof ExtendedType);
assertEquals(Uint8.getInstance(), version.getType().getBaseType());
assertEquals(expectedQName, type.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, type.getPath());
assertTrue(type.getType() instanceof ExtendedType);
assertTrue(type.isAddedByUses());
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, sc.getPath());
assertFalse(sc.isAddedByUses());
// * |-- |-- |-- container p2p
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "p2p");
assertEquals(expectedQName, p2p.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, p2p.getPath());
assertFalse(p2p.isAddedByUses());
// * |-- |-- |-- |-- container endpoints
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "endpoints");
assertEquals(expectedQName, endpoints.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, endpoints.getPath());
assertFalse(endpoints.isAddedByUses());
// * |-- |-- |-- |-- |-- leaf processing-rule
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, box.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, box.getPath());
assertTrue(box.isAddedByUses());
// * |-- |-- |-- |-- |-- choice address-family
assertEquals(expectedQName, af.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, af.getPath());
assertTrue(af.isAddedByUses());
// * |-- |-- |-- |-- container reported-route
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, reportedRoute.getPath());
assertFalse(reportedRoute.isAddedByUses());
// * |-- |-- |-- |-- |-- leaf processing-rule
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, subobjects.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, subobjects.getPath());
assertTrue(subobjects.isAddedByUses());
// * |-- |-- |-- |-- |-- container bandwidth
assertEquals(expectedQName, bandwidth.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, bandwidth.getPath());
assertFalse(bandwidth.isAddedByUses());
// * |-- |-- |-- |-- container bandwidth
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, bandwidth.getPath());
assertTrue(bandwidth.isAddedByUses());
// * |-- |-- |-- |-- |-- leaf processing-rule
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "processing-rule");
assertEquals(expectedQName, processingRule.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, bandwidth.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, bandwidthInner.getPath());
assertTrue(bandwidthInner.isAddedByUses());
// * |-- list svec
path.pollLast();
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, svec.getPath());
assertFalse(svec.isAddedByUses());
// * |-- |-- leaf link-diverse
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "link-diverse");
assertEquals(expectedQName, linkDiverse.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, linkDiverse.getPath());
assertEquals(BooleanType.getInstance(), linkDiverse.getType());
assertTrue(linkDiverse.isAddedByUses());
assertEquals(expectedQName, processingRule.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertEquals(expectedQName, metric.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, metric.getPath());
assertFalse(metric.isAddedByUses());
// * |-- |-- |-- leaf metric-type
expectedQName = new QName(UG_NS, UG_REV, UG_PREF, "metric-type");
assertEquals(expectedQName, metricType.getQName());
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, metricType.getPath());
assertEquals(Uint8.getInstance(), metricType.getType());
assertTrue(metricType.isAddedByUses());
assertEquals(expectedQName, box.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, box.getPath());
assertTrue(box.isAddedByUses());
// * |-- |-- |-- leaf processing-rule
assertEquals(expectedQName, processingRule.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, processingRule.getPath());
assertEquals(BooleanType.getInstance(), processingRule.getType());
assertTrue(processingRule.isAddedByUses());
assertEquals(expectedQName, ignore.getQName());
path.pollLast();
path.offer(expectedQName);
- expectedPath= new SchemaPath(path, true);
+ expectedPath= SchemaPath.create(path, true);
assertEquals(expectedPath, ignore.getPath());
assertEquals(BooleanType.getInstance(), ignore.getType());
assertTrue(ignore.isAddedByUses());
assertNotNull(intExt);
List<QName> path = Lists.newArrayList(new QName(GD_NS, GD_REV, GD_PREF, "int-ext"));
- SchemaPath expectedPath = new SchemaPath(path, true);
+ SchemaPath expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, intExt.getPath());
UnionType union = (UnionType)intExt.getBaseType();
assertNotNull(pv);
QName q1 = BaseTypes.constructQName("union");
- expectedPath = new SchemaPath(Lists.newArrayList(q1), true);
+ expectedPath = SchemaPath.create(Lists.newArrayList(q1), true);
assertEquals(expectedPath, union.getPath());
}
*/
package org.opendaylight.yangtools.yang.parser.impl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.net.URI;
import java.text.DateFormat;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.*;
+import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
+import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
+import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.api.MustDefinition;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.UsesNode;
public class YangParserSimpleTest {
private final URI snNS = URI.create("urn:opendaylight:simple-nodes");
private Date rev;
private final String prefix = "sn";
- private SchemaPath createPath(String... names) {
+ private SchemaPath createPath(final String... names) {
try {
rev = new SimpleDateFormat("yyyy-MM-dd").parse("2013-07-30");
} catch (ParseException e) {
for (String name : names) {
path.add(new QName(ns, rev, prefix, name));
}
- return new SchemaPath(path, true);
+ return SchemaPath.create(path, true);
}
}
*/
package org.opendaylight.yangtools.yang.parser.impl;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.util.Uint32;
import org.opendaylight.yangtools.yang.model.util.UnionType;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
public class YangParserTest {
public static final String FS = File.separator;
List<QName> path = new ArrayList<>();
path.add(new QName(barNS, barRev, "br", "interfaces"));
path.add(new QName(barNS, barRev, "br", "ifEntry"));
- SchemaPath expectedPath = new SchemaPath(path, true);
+ SchemaPath expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, dev.getTargetPath());
assertEquals(Deviate.ADD, dev.getDeviate());
assertSetEquals(newModules, ctx.getModules());
}
- private void checkOrder(Collection<Module> modules) {
+ private void checkOrder(final Collection<Module> modules) {
Iterator<Module> it = modules.iterator();
Module m = it.next();
assertEquals("m2", m.getName());
assertEquals("m1", m.getName());
}
- private void assertSetEquals(Set<Module> s1, Set<Module> s2) {
+ private void assertSetEquals(final Set<Module> s1, final Set<Module> s2) {
assertEquals(s1, s2);
Iterator<Module> it = s1.iterator();
for (Module m : s2) {
import org.junit.Ignore;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.*;
+import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.ChoiceNode;
+import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.Deviation;
import org.opendaylight.yangtools.yang.model.api.Deviation.Deviate;
+import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
+import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
+import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.api.MustDefinition;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.UsesNode;
import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
import org.opendaylight.yangtools.yang.model.util.ExtendedType;
QName qname = new QName(URI.create("urn:opendaylight.baz"), simpleDateFormat.parse("2013-02-27"), "baz",
"target");
path.add(qname);
- SchemaPath expectedPath = new SchemaPath(path, true);
+ SchemaPath expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, usesNode.getGroupingPath());
// test refine
List<QName> path = new ArrayList<>();
path.add(new QName(expectedNS, expectedRev, "bar", "interfaces"));
path.add(new QName(expectedNS, expectedRev, "bar", "ifEntry"));
- SchemaPath expectedPath = new SchemaPath(path, true);
+ SchemaPath expectedPath = SchemaPath.create(path, true);
assertEquals(expectedPath, dev.getTargetPath());
assertEquals(Deviate.ADD, dev.getDeviate());
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
import org.junit.Test;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.*;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.parser.builder.impl.ModuleBuilder;
import org.opendaylight.yangtools.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
List<QName> qnamesA = new ArrayList<>();
qnamesA.add(qnameA1);
qnamesA.add(qnameA2);
- SchemaPath schemaPathA = new SchemaPath(qnamesA, true);
+ SchemaPath schemaPathA = SchemaPath.create(qnamesA, true);
QName qnameB = new QName(uriB, new Date(5000000), "some name");
List<QName> qnamesB = new ArrayList<>();
qnamesB.add(qnameB1);
qnamesB.add(qnameB2);
- SchemaPath schemaPathB = new SchemaPath(qnamesB, true);
+ SchemaPath schemaPathB = SchemaPath.create(qnamesB, true);
BitImpl biB = null;
BitImpl biA = new BitImpl(55L, qnameA, schemaPathA, "description", "reference", Status.CURRENT, null);
rh1.setReference("reference");
}
- private URI getUri(String uri) {
+ private URI getUri(final String uri) {
URI simpleUri = null;
boolean instantionated = false;
try {
List<QName> qnamesB = new ArrayList<>();
qnamesA.add(qnameA);
qnamesB.add(qnameB);
- SchemaPath schemaPathB = new SchemaPath(qnamesB, true);
+ SchemaPath schemaPathB = SchemaPath.create(qnamesB, true);
UnknownSchemaNodeBuilder usnb = new UnknownSchemaNodeBuilder("usnb", 151, new QName(simpleUri, "tst"), schemaPathB);
UnknownSchemaNodeBuilder usnb1 = new UnknownSchemaNodeBuilder("usnb", 151, new QName(simpleUri, "tst"), schemaPathB);