org.nhindirect.xd.common.type
Enum DirectDocumentType

java.lang.Object
  extended by java.lang.Enum<DirectDocumentType>
      extended by org.nhindirect.xd.common.type.DirectDocumentType
All Implemented Interfaces:
Serializable, Comparable<DirectDocumentType>

public enum DirectDocumentType
extends Enum<DirectDocumentType>

Enumeration of document types. Order of enumerations is important, and should go from most specific to least specific.

Author:
beau

Enum Constant Summary
CCD
           
HTML
           
PDF
           
TEXT
           
UNKNOWN
           
XDM
           
XML
           
 
Method Summary
 FormatCodeEnum getFormatCode()
          Return the value of formatCode.
 MimeType getMimeType()
          Return the value of mimeType.
static DirectDocumentType lookup(javax.mail.BodyPart bodyPart)
          Lookup and return the DirectDocumentType which most closely matches the provided BodyPart.
static DirectDocumentType lookup(javax.mail.internet.MimeMessage mimeMessage)
          Lookup and return the DirectDocumentType which most closely matches the provided MimeMessage.
 boolean matches(javax.mail.BodyPart bodyPart)
          Check to see if the BodyPart matches the current DirectDocumentType.
 boolean matches(javax.mail.internet.MimeMessage mimeMessage)
          Check to see if the MimeMessage matches the current DirectDocumentType.
 boolean matches(String data, String contentType, String fileName)
          Check to see if the BodyPart matches the provided params.
 void parse(String data, DirectDocument2.Metadata metadata)
          Parse the document for additional metadata values.
 void parse(String data, DirectDocuments.SubmissionSet submissionSet)
          Parse the document for additional submissionSet values.
static DirectDocumentType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DirectDocumentType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CCD

public static final DirectDocumentType CCD

XDM

public static final DirectDocumentType XDM

PDF

public static final DirectDocumentType PDF

XML

public static final DirectDocumentType XML

HTML

public static final DirectDocumentType HTML

TEXT

public static final DirectDocumentType TEXT

UNKNOWN

public static final DirectDocumentType UNKNOWN
Method Detail

values

public static DirectDocumentType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DirectDocumentType c : DirectDocumentType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DirectDocumentType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

matches

public boolean matches(javax.mail.internet.MimeMessage mimeMessage)
                throws javax.mail.MessagingException,
                       IOException
Check to see if the MimeMessage matches the current DirectDocumentType.

Parameters:
mimeMessage - The MimeMessage object to compare against the current DirectDocumentType.
Returns:
true if the current DirectDocumentType matches, false otherwise.
Throws:
javax.mail.MessagingException
IOException

matches

public boolean matches(javax.mail.BodyPart bodyPart)
                throws javax.mail.MessagingException,
                       IOException
Check to see if the BodyPart matches the current DirectDocumentType.

Parameters:
bodyPart - The BodyPart object to compare against the current DirectDocumentType.
Returns:
true if the current DirectDocumentType matches, false otherwise.
Throws:
javax.mail.MessagingException
IOException

matches

public boolean matches(String data,
                       String contentType,
                       String fileName)
Check to see if the BodyPart matches the provided params. The default implementation checks only the contentType param. More specific enumerations should override this method with custom matching logic.

Parameters:
data - The document contents.
contentType - The document content type.
fileName - The document file name.
Returns:
true it the DirectDocumentType matches, false otherwise.

parse

public void parse(String data,
                  DirectDocuments.SubmissionSet submissionSet)
           throws Exception
Parse the document for additional submissionSet values. This method should be overridden by parsable document types.

Parameters:
data - The document data.
submissionSet - The submissionSet object to populate.
Throws:
Exception

parse

public void parse(String data,
                  DirectDocument2.Metadata metadata)
           throws Exception
Parse the document for additional metadata values. This method should be overridden by parsable document types.

Parameters:
data - The document data.
metadata - The metadata object to populate.
Throws:
Exception

lookup

public static DirectDocumentType lookup(javax.mail.internet.MimeMessage mimeMessage)
                                 throws javax.mail.MessagingException,
                                        IOException
Lookup and return the DirectDocumentType which most closely matches the provided MimeMessage.

Parameters:
mimeMessage - The MimeMessage to match up with a DirectDocumentType.
Returns:
the most closely matching DirectDocumentType.
Throws:
javax.mail.MessagingException
IOException

lookup

public static DirectDocumentType lookup(javax.mail.BodyPart bodyPart)
                                 throws javax.mail.MessagingException,
                                        IOException
Lookup and return the DirectDocumentType which most closely matches the provided BodyPart.

Parameters:
bodyPart - The BodyPart to match up with a directDocumentType.
Returns:
the most closely matching DirectDocumentType.
Throws:
javax.mail.MessagingException
IOException

getFormatCode

public FormatCodeEnum getFormatCode()
Return the value of formatCode.

Returns:
the formatCode.

getMimeType

public MimeType getMimeType()
Return the value of mimeType.

Returns:
the mimeType.


Copyright © 2010-2011. All Rights Reserved.