Class Base16BlobConverter

java.lang.Object
org.incenp.linkml.core.converters.ScalarConverterBase
org.incenp.linkml.core.converters.Base16BlobConverter
All Implemented Interfaces:
IConverter

public class Base16BlobConverter extends ScalarConverterBase
A converter for slots typed as xsd:hexBinary.

Such slots are represented in this runtime as BinaryBlob fields.

  • Constructor Details

    • Base16BlobConverter

      public Base16BlobConverter()
  • Method Details

    • getType

      public Class<?> getType()
      Description copied from interface: IConverter
      Gets the type of object that this converter can convert a raw object into.
      Returns:
      The Java type representing the LinkML object this converter is intended for.
    • getURI

      public String getURI()
      Description copied from interface: IConverter
      Gets the URI identifying the LinkML type this converter is intended for.

      This is intended to provide another way to look up converter objects, if looking up by the Java type (using IConverter.getType()) is not enough (typically, when several LinkML types are rendered using the same Java type).

      Returns:
      The LinkML type URI. May be null.
    • convertImpl

      protected Object convertImpl(Object raw, ConverterContext ctx) throws LinkMLRuntimeException
      Description copied from class: ScalarConverterBase
      Performs the actual type conversion.
      Specified by:
      convertImpl in class ScalarConverterBase
      Parameters:
      raw - The raw object to convert. This is guaranteed to be a non-null, non-list, non-dictionary object.
      Returns:
      The converted value.
      Throws:
      LinkMLRuntimeException - If the converter cannot convert the given value.
    • serialise

      public Object serialise(Object object, ConverterContext ctx) throws LinkMLRuntimeException
      Description copied from interface: IConverter
      Converts a LinkML object into a raw object.

      Given the Java representation of a LinkML object, this method shall return an object suitable to be given to a generic JSON/YAML writer.

      Specified by:
      serialise in interface IConverter
      Overrides:
      serialise in class ScalarConverterBase
      Parameters:
      object - The LinkML object to convert.
      ctx - The global converter context.
      Returns:
      The raw object that represents the original LinkML object.
      Throws:
      LinkMLRuntimeException - If the converter cannot convert the given object.