Laden von jadice Annotationen

Alle jadice Annotationen eines Dokumentes sind in einem einzigen Datenobjekt (XML-Format) zusammengefasst.

Codebeispiel:

      // Jadice Profil laden
	  // Hier wird das "default" Profil verwendet
      final URL profileUrl = JadiceAnnotationReader.class.getResource("/default-annotation-profile.xml");
      final AnnotationProfile profile = AnnotationProfile.load(profileUrl);

      // Vordefiniertes Profil im Document setzen
      <<Document-Instanz>>.getProperties().put(AnnotationProfile.class.getName(), profile);
      
      final DefaultReaderControls controls = new DefaultReaderControls();
      controls.getSettings(JadiceAnnotationReaderSettings.class).setAnnotationProfile(profile);

      Reader reader = new Reader();
	  // Document-Instanz setzen
      reader.setDocument(<<Document-Instanz>>);
      reader.setReaderControls(controls);
      // Startseitenindex setzen
      reader.setTargetIndex(0); 
      // Jadice Annotation Format setzen
      reader.setFormat(new JadiceAnnotationFormat());
      reader.read(<<Annotation-Inputstream>>);
      reader.complete();

JadiceAnnotationReaderSettings Konfiguration:

  • setEncoding(String) (Default = "utf-8")

    Hier kann ein Encoding gesetzt werden.

    Zu beachten: Wenn ein anderes Encoding als UTF-8 verwendet wird, muss das entsprechende Encoding beim Speichern in den JadiceAnnotationWriterSettings gesetzt werden.

  • setIgnoreUndefinedAnnotationProperty(boolean) (Default = false)

    Bei der Einstellung true werden Attribute, die nicht im Annotationsprofil definiert sind, ignoriert und es wird kein Fehler ausgelöst.

[jadice document platform Version 5.6.10.6: Dokumentation für Entwickler. Veröffentlicht: 2024-01-18]