Package io.goobi.viewer.model.annotation
Class AnnotationConverter
java.lang.Object
io.goobi.viewer.model.annotation.AnnotationConverter
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.annotation.oa.OpenAnnotationGets the annotation as anOpenAnnotationjava object.getAsPersistentAnnotation(de.intranda.api.annotation.wa.WebAnnotation anno) de.intranda.api.annotation.wa.WebAnnotationGets the annotation as anWebAnnotationjava object.de.intranda.api.annotation.IResourcegetBodyAsOAResource.de.intranda.api.annotation.IResourceGets the body of the given annotation as a resource.de.intranda.api.annotation.IResourceGets the annotation target as an OpenAnnotationIResourcejava object.de.intranda.api.annotation.IResourceGets the annotation target as an WebAnnotationIResourcejava object.
-
Constructor Details
-
AnnotationConverter
public AnnotationConverter() -
AnnotationConverter
-
-
Method Details
-
getTargetAsResource
public de.intranda.api.annotation.IResource getTargetAsResource(PersistentAnnotation anno) throws IOException Gets the annotation target as an WebAnnotationIResourcejava 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 OpenAnnotationIResourcejava 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
Gets the annotation as anWebAnnotationjava object.- Parameters:
anno- the persistent annotation to convert- Returns:
- the WebAnnotation representation of the given persistent annotation
- Throws:
DAOException
-
getAsOpenAnnotation
Gets the annotation as anOpenAnnotationjava 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
-