com.levigo.jadice.document.att
Class Attachments

java.lang.Object
  extended by com.levigo.jadice.document.att.Attachments

public class Attachments
extends Object

Helper methods for dealing with Attachments.


Method Summary
static SeekableInputStream createDefaultStream(Attachment attachment)
           
static Collection<Attachment> getAttachments(Document document, DocumentLayer layer)
          This method gathers all the Attachments which are bound to any PageSegment that is in the given DocumentLayer of any Page in the given Document.
static Collection<Attachment> getAttachments(Page page, DocumentLayer layer)
          Retrieves the Attachments which are bound to the PageSegment found in the given Page at the given DocumentLayer
static Collection<Attachment> getDefaultLayerAttachments(Document document)
          This method gathers all the Attachments which are bound to any PageSegment that is in the default DocumentLayer (DocumentLayer.DEFAULT) of any Page in the given Document.
static Collection<Attachment> getDefaultLayerAttachments(Page page)
          Retrieves the Attachments which are bound to the PageSegment found in the given Page's default layer (DocumentLayer.DEFAULT).
static boolean hasAttachments(Document document, DocumentLayer layer)
           
static boolean hasAttachments(Page page, DocumentLayer layer)
           
static boolean hasDefaultLayerAttachments(Document document)
           
static boolean hasDefaultLayerAttachments(Page page)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasAttachments

public static boolean hasAttachments(Document document,
                                     DocumentLayer layer)
Parameters:
document - the Document in question
layer - the DocumentLayer in which to find the PageSegment which are searched for Attachments
Returns:
true if there is at least one Attachment bound to a PageSegment in the given layer of one of the Pages contained in the given Document; false otherwise.

hasDefaultLayerAttachments

public static boolean hasDefaultLayerAttachments(Document document)
Parameters:
document - the Document in question
Returns:
true if there is at least one Attachment bound to a PageSegment in the default layer (DocumentLayer.DEFAULT) of one of the Pages contained in the given Document; false otherwise.

hasAttachments

public static boolean hasAttachments(Page page,
                                     DocumentLayer layer)
Parameters:
page - the Page in question
layer - the DocumentLayer in which to find the PageSegment which are searched for Attachments
Returns:
true if there is a PageSegment in the given DocumentLayer of the given Page and at least one Attachment is bound to this PageSegment; false otherwise.

hasDefaultLayerAttachments

public static boolean hasDefaultLayerAttachments(Page page)
Parameters:
page - the Page in question
Returns:
true if there is a PageSegment in the given Page's default layer (DocumentLayer.DEFAULT) and at least one Attachment is bound to it; false otherwise.

getAttachments

public static Collection<Attachment> getAttachments(Document document,
                                                    DocumentLayer layer)
This method gathers all the Attachments which are bound to any PageSegment that is in the given DocumentLayer of any Page in the given Document.

Parameters:
document - the Document to find Attachments for
layer - the DocumentLayer in which to look for Attachments
Returns:
Attachments of the given Document's PageSegments in the given DocumentLayer

getDefaultLayerAttachments

public static Collection<Attachment> getDefaultLayerAttachments(Document document)
This method gathers all the Attachments which are bound to any PageSegment that is in the default DocumentLayer (DocumentLayer.DEFAULT) of any Page in the given Document.

Parameters:
document - the Document to retrieve attachments for
Returns:
Attachments of the given Document's PageSegments in the default DocumentLayer

getAttachments

public static Collection<Attachment> getAttachments(Page page,
                                                    DocumentLayer layer)
Retrieves the Attachments which are bound to the PageSegment found in the given Page at the given DocumentLayer

Parameters:
page - the page of which to get Attachments
layer - the DocumentLayer for which Attachments are to be returned
Returns:
Attachments bound to the given Page's given layer, or null if none are bound or if there is no PageSegment in the given layer.

getDefaultLayerAttachments

public static Collection<Attachment> getDefaultLayerAttachments(Page page)
Retrieves the Attachments which are bound to the PageSegment found in the given Page's default layer (DocumentLayer.DEFAULT).

Parameters:
page - the page of which to get the default layer's Attachments
Returns:
Attachments bound to the given page's default layer, or null if none are bound or if there is no PageSegment in the default layer.

createDefaultStream

public static SeekableInputStream createDefaultStream(Attachment attachment)
                                               throws IOException
Throws:
IOException


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.