import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaNode;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.TypedSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.TypedDataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
final NormalizedNodeContext currentNodeContext = (NormalizedNodeContext) context;
final SchemaContext schemaContext = getSchemaContext(currentNodeContext);
- final TypedSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
+ final TypedDataSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
currentNodeContext);
final Object nodeValue = currentNodeContext.getNode().getValue();
private static NormalizedNode<?, ?> getNodeReferencedByLeafref(final RevisionAwareXPath xpath,
final NormalizedNodeContext currentNodeContext, final SchemaContext schemaContext,
- final TypedSchemaNode correspondingSchemaNode, final Object nodeValue) {
+ final TypedDataSchemaNode correspondingSchemaNode, final Object nodeValue) {
final NormalizedNode<?, ?> referencedNode = xpath.isAbsolute() ? getNodeReferencedByAbsoluteLeafref(xpath,
currentNodeContext, schemaContext, correspondingSchemaNode) : getNodeReferencedByRelativeLeafref(xpath,
currentNodeContext, schemaContext, correspondingSchemaNode);
private static NormalizedNode<?, ?> getNodeReferencedByAbsoluteLeafref(final RevisionAwareXPath xpath,
final NormalizedNodeContext currentNodeContext, final SchemaContext schemaContext,
- final TypedSchemaNode correspondingSchemaNode) {
+ final TypedDataSchemaNode correspondingSchemaNode) {
final LeafrefXPathStringParsingPathArgumentBuilder builder = new LeafrefXPathStringParsingPathArgumentBuilder(
xpath.toString(), schemaContext, correspondingSchemaNode, currentNodeContext);
final List<PathArgument> pathArguments = builder.build();
private static NormalizedNode<?, ?> getNodeReferencedByRelativeLeafref(final RevisionAwareXPath xpath,
final NormalizedNodeContext currentNodeContext, final SchemaContext schemaContext,
- final TypedSchemaNode correspondingSchemaNode) {
+ final TypedDataSchemaNode correspondingSchemaNode) {
NormalizedNodeContext relativeNodeContext = currentNodeContext;
final StringBuilder xPathStringBuilder = new StringBuilder(xpath.toString());
// strip the relative path of all ../ at the beginning
final NormalizedNodeContext currentNodeContext = (NormalizedNodeContext) context;
final SchemaContext schemaContext = getSchemaContext(currentNodeContext);
- final TypedSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
+ final TypedDataSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
currentNodeContext);
if (!(correspondingSchemaNode.getType() instanceof IdentityrefTypeDefinition)) {
final NormalizedNodeContext currentNodeContext = (NormalizedNodeContext) context;
final SchemaContext schemaContext = getSchemaContext(currentNodeContext);
- final TypedSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
+ final TypedDataSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
currentNodeContext);
if (!(correspondingSchemaNode.getType() instanceof IdentityrefTypeDefinition)) {
}
private static IdentitySchemaNode getIdentitySchemaNodeFromString(final String identity,
- final SchemaContext schemaContext, final TypedSchemaNode correspondingSchemaNode) {
+ final SchemaContext schemaContext, final TypedDataSchemaNode correspondingSchemaNode) {
final List<String> identityPrefixAndName = COLON_SPLITTER.splitToList(identity);
final Module module = schemaContext.findModule(correspondingSchemaNode.getQName().getModule()).get();
if (identityPrefixAndName.size() == 2) {
final NormalizedNodeContext currentNodeContext = (NormalizedNodeContext) context;
final SchemaContext schemaContext = getSchemaContext(currentNodeContext);
- final TypedSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
+ final TypedDataSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
currentNodeContext);
final TypeDefinition<?> nodeType = correspondingSchemaNode.getType();
final NormalizedNodeContext currentNodeContext = (NormalizedNodeContext) context;
final SchemaContext schemaContext = getSchemaContext(currentNodeContext);
- final TypedSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
+ final TypedDataSchemaNode correspondingSchemaNode = getCorrespondingTypedSchemaNode(schemaContext,
currentNodeContext);
final TypeDefinition<?> nodeType = correspondingSchemaNode.getType();
return ((NormalizedNodeContextSupport) contextSupport).getSchemaContext();
}
- private static TypedSchemaNode getCorrespondingTypedSchemaNode(final SchemaContext schemaContext,
+ private static TypedDataSchemaNode getCorrespondingTypedSchemaNode(final SchemaContext schemaContext,
final NormalizedNodeContext currentNodeContext) {
Iterator<NormalizedNodeContext> ancestorOrSelfAxisIterator;
try {
Preconditions.checkNotNull(schemaNode, "Node %s does not have a corresponding SchemaNode in the SchemaContext.",
currentNodeContext.getNode());
- Preconditions.checkState(schemaNode instanceof TypedSchemaNode, "Node %s must be a leaf or a leaf-list.",
+ Preconditions.checkState(schemaNode instanceof TypedDataSchemaNode, "Node %s must be a leaf or a leaf-list.",
currentNodeContext.getNode());
- return (TypedSchemaNode) schemaNode;
+ return (TypedDataSchemaNode) schemaNode;
}
// Singleton instance of reuse