Class FileSchemaSource

java.lang.Object
org.incenp.linkml.schema.FileSchemaSource
All Implemented Interfaces:
ISchemaSource

public class FileSchemaSource extends Object implements ISchemaSource
Represents a schema location pointing to a local file.
  • Constructor Details

    • FileSchemaSource

      public FileSchemaSource(File file)
      Creates a new instance from a File object.
      Parameters:
      file - The file object expected to contain the schema.
    • FileSchemaSource

      public FileSchemaSource(String filename)
      Creates a new instance from a filename.
      Parameters:
      filename - The name of the file expected to contain the schema.
  • Method Details

    • getBase

      public String getBase()
      Description copied from interface: ISchemaSource
      Gets the base location of this source.

      The base location is the location from which relative import references are resolved.

      Specified by:
      getBase in interface ISchemaSource
      Returns:
      The base location. May be null.
    • getStream

      public InputStream getStream() throws IOException
      Description copied from interface: ISchemaSource
      Opens the location into a readable stream.
      Specified by:
      getStream in interface ISchemaSource
      Throws:
      IOException - If the location cannot be opened for any reason.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object