io.apicurio.datamodels.deref.InternalRefResolverVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apicurio-data-models Show documentation
Show all versions of apicurio-data-models Show documentation
Open Source API Design Studio
The newest version!
package io.apicurio.datamodels.deref;
import io.apicurio.datamodels.models.Node;
import io.apicurio.datamodels.models.Referenceable;
/**
* Simple visitor used to mark internal references as "resolved".
* @author [email protected]
*/
public class InternalRefResolverVisitor extends AllReferenceableNodeVisitor {
@Override
protected void visitReferenceableNode(Referenceable refNode) {
String ref = refNode.get$ref();
// Internal refs are marked as resolved
if (ref.startsWith("#/")) {
Node node = (Node) refNode;
node.setNodeAttribute(DereferenceConstants.KEY_RESOLUTION, DereferenceConstants.VALUE_RESOLVED);
}
}
}