Package io.apicurio.registry.maven.refs
Class ReferenceIndex
java.lang.Object
io.apicurio.registry.maven.refs.ReferenceIndex
An index of the files available when discovering references in an artifact. This index is typically
populated by getting a list of all files in a directory, or zip file. The index maps a resource name (this
will vary depending on the artifact type) to the content of the resource. For example, Avro schemas will
have resource names based on the qualified name of the type they define. JSON Schemas will have resources
names based on the name of the file. The intent of this index is to resolve an external reference found in
an artifact to an actual piece of content (e.g. file) in the index. If it cannot be resolved, that would
typically mean that there is a broken reference in the schema/design.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSchemaPath
(Path path) void
Index an existing (remote) reference using a resource name and remote artifact metadata.void
Index the given content.Look up a resource in the index.
-
Constructor Details
-
ReferenceIndex
public ReferenceIndex()Constructor. -
ReferenceIndex
Constructor.- Parameters:
schemaPath
-
-
-
Method Details
-
addSchemaPath
- Parameters:
path
-
-
lookup
Look up a resource in the index. Returnsnull
if no resource with that name is found.- Parameters:
resourceName
-relativeToFile
-
-
index
Index an existing (remote) reference using a resource name and remote artifact metadata.- Parameters:
resourceName
-vmd
-
-
index
Index the given content. Indexing will parse the content and figure out its resource name and type.- Parameters:
path
-content
-
-