Class AnnotationConverter

java.lang.Object
io.goobi.viewer.model.annotation.AnnotationConverter

public class AnnotationConverter extends Object
Author:
Florian Alpers
  • Constructor Details

    • AnnotationConverter

      public AnnotationConverter()
    • AnnotationConverter

      public AnnotationConverter(AbstractApiUrlManager urls)
  • Method Details

    • getTargetAsResource

      public de.intranda.api.annotation.IResource getTargetAsResource(PersistentAnnotation anno) throws IOException
      Gets the annotation target as an WebAnnotation IResource java object.
      Parameters:
      anno - the annotation whose target is to be resolved
      Returns:
      the annotation target as a WebAnnotation resource, or null if no target is set
      Throws:
      IOException - if any.
    • getTargetAsOAResource

      public de.intranda.api.annotation.IResource getTargetAsOAResource(PersistentAnnotation anno) throws IOException
      Gets the annotation target as an OpenAnnotation IResource java object.
      Parameters:
      anno - the annotation whose target is to be resolved
      Returns:
      the annotation target as an OpenAnnotation resource, or null if no target is set
      Throws:
      IOException - if any.
    • getBodyAsResource

      public de.intranda.api.annotation.IResource getBodyAsResource(PersistentAnnotation anno) throws IOException
      Gets the body of the given annotation as a resource.
      Parameters:
      anno - the annotation whose body is to be resolved
      Returns:
      the annotation body as a resource, or null if no body is set
      Throws:
      IOException - if any.
    • getBodyAsOAResource

      public de.intranda.api.annotation.IResource getBodyAsOAResource(PersistentAnnotation anno) throws IOException
      getBodyAsOAResource.
      Parameters:
      anno - the annotation whose body is to be resolved as OA resource
      Returns:
      the annotation body as an OpenAnnotation resource, or null if no body is set
      Throws:
      IOException - if any.
    • getAsWebAnnotation

      public de.intranda.api.annotation.wa.WebAnnotation getAsWebAnnotation(PersistentAnnotation anno)
      Gets the annotation as an WebAnnotation java object.
      Parameters:
      anno - the persistent annotation to convert
      Returns:
      the WebAnnotation representation of the given persistent annotation
      Throws:
      DAOException
    • getAsOpenAnnotation

      public de.intranda.api.annotation.oa.OpenAnnotation getAsOpenAnnotation(PersistentAnnotation anno)
      Gets the annotation as an OpenAnnotation java object.
      Parameters:
      anno - persistent annotation to convert to an OpenAnnotation object
      Returns:
      the OpenAnnotation representation of the given persistent annotation
      Throws:
      com.fasterxml.jackson.core.JsonParseException - if any.
      com.fasterxml.jackson.databind.JsonMappingException - if any.
      IOException - if any.
    • getAsPersistentAnnotation

      public PersistentAnnotation getAsPersistentAnnotation(de.intranda.api.annotation.wa.WebAnnotation anno)
      Parameters:
      anno - the web annotation to convert
      Returns:
      PersistentAnnotation