Class AnnotationImageResolver
java.lang.Object
com.levigo.jadice.web.server.annotation.AnnotationImageResolver
The AnnotationImageResolver maps specific AnnotationProfiles onto appropriate
AnnotationImageProviders. Therefore providers can be registered and requested by their
annotation profile name.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.levigo.jadice.document.io.SeekableInputStreamgetAnnotationImage(String annotationProfileName, String annotationImageID) Obtains a image for a givenAnnotationProfileand image identifer.static booleanregisterAnnotationImageProvider(String annotationProfileName, AnnotationImageProvider annotationImageProvider) Registers aAnnotationImageProviderfor a given AnnotationProfile.
-
Constructor Details
-
AnnotationImageResolver
public AnnotationImageResolver()
-
-
Method Details
-
getAnnotationImage
public static com.levigo.jadice.document.io.SeekableInputStream getAnnotationImage(String annotationProfileName, String annotationImageID) throws IllegalStateException, IOException Obtains a image for a givenAnnotationProfileand image identifer.- Parameters:
annotationProfileName- the name of the annotation profile.annotationImageID- the id of the requested image- Returns:
- the appropriate
AnnotationImageProvider. - Throws:
NullPointerException- if the argument wasnull.IllegalStateException- if no appropriateAnnotationImageProviderwas found.IOException- if the image couldn't be loaded/obtained.
-
registerAnnotationImageProvider
public static boolean registerAnnotationImageProvider(String annotationProfileName, AnnotationImageProvider annotationImageProvider) throws IllegalArgumentException Registers aAnnotationImageProviderfor a given AnnotationProfile. Multiple registrations for the same profile will result in nothing happening.- Parameters:
annotationProfileName- the name of the annotation profile.annotationImageProvider- the appropriate annotation image provider.- Returns:
trueif added successfully, elsefalse- Throws:
NullPointerException- if the given profile name or annotation image provider wasnull.IllegalArgumentException
-