|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.scripting.engine.Variable
com.sun.slamd.scripting.mail.MailMessageVariable
This class defines a variable that stores a mail message, including headers. This message may be either retrieved via POP or IMAP or send via SMTP. A mail message has the following methods:
| Field Summary | |
static java.lang.String |
ADD_BODY_LINE_METHOD_NAME
The name of the method that can be used to add a line to the body of this message. |
static int |
ADD_BODY_LINE_METHOD_NUMBER
The method number for the "addBodyLine" method. |
static java.lang.String |
ADD_BODY_LINES_METHOD_NAME
The name of the method that can be used to add multiple lines to the body of this message. |
static int |
ADD_BODY_LINES_METHOD_NUMBER
The method number for the "addBodyLines" method. |
static java.lang.String |
ADD_CC_RECIPIENT_METHOD_NAME
The name of the method that can be used to add a CC recipient to this message. |
static int |
ADD_CC_RECIPIENT_METHOD_NUMBER
The method number for the "addCCRecipient" method. |
static java.lang.String |
ADD_HEADER_LINE_METHOD_NAME
The name of the method that can be used to add a line to the set of headers for this message. |
static int |
ADD_HEADER_LINE_METHOD_NUMBER
The method number for the "addHeaderLine" method. |
static java.lang.String |
ADD_TO_RECIPIENT_METHOD_NAME
The name of the method that can be used to add a To recipient to this message. |
static int |
ADD_TO_RECIPIENT_METHOD_NUMBER
The method number for the "addToRecipient" method. |
static java.lang.String |
ASSIGN_METHOD_NAME
The name of the method that can be used to assign a value to this message. |
static int |
ASSIGN_METHOD_NUMBER
The method number for the "assign" method. |
static java.lang.String |
CLEAR_BODY_METHOD_NAME
The name of the method that can be used to clear the contents of the message body. |
static int |
CLEAR_BODY_METHOD_NUMBER
The method number for the "clearBody" method. |
static java.lang.String |
CLEAR_HEADER_METHOD_NAME
The name of the method that can be used to clear the contents of the message header. |
static int |
CLEAR_HEADER_METHOD_NUMBER
The method number for the "clearHeader" method. |
static java.lang.String |
CLEAR_METHOD_NAME
The name of the method that can be used to clear the contents of this message. |
static int |
CLEAR_METHOD_NUMBER
The method number for the "clear" method. |
static java.lang.String |
GET_BODY_LINES_METHOD_NAME
The name of the method that can be used to retrieve the lines of the body of this message. |
static int |
GET_BODY_LINES_METHOD_NUMBER
The method number for the "getBodyLines" method. |
static java.lang.String |
GET_CC_RECIPIENTS_METHOD_NAME
The name of the method that can be used to retrieve the list of CC recipients for this message. |
static int |
GET_CC_RECIPIENTS_METHOD_NUMBER
The method number for the "getCCRecipients" method. |
static java.lang.String |
GET_HEADER_LINES_METHOD_NAME
The name of the method that can be used to retrieve the list of header lines for this message. |
static int |
GET_HEADER_LINES_METHOD_NUMBER
The method number for the "getHeaderLines" method. |
static java.lang.String |
GET_HEADER_METHOD_NAME
The name of the method that can be used to retrieve a specific header for this message. |
static int |
GET_HEADER_METHOD_NUMBER
The method number for the "getHeader" method. |
static java.lang.String |
GET_SENDER_METHOD_NAME
The name of the method that can be used to clear the address of the sender for this message. |
static int |
GET_SENDER_METHOD_NUMBER
The method number for the "getSender" method. |
static java.lang.String |
GET_SUBJECT_METHOD_NAME
The name of the method that can be used to retrieve the subject of this message. |
static int |
GET_SUBJECT_METHOD_NUMBER
The method number for the "getSubject" method. |
static java.lang.String |
GET_TO_RECIPIENTS_METHOD_NAME
The name of the method that can be used to retrieve the list of "To" recipients for this message. |
static int |
GET_TO_RECIPIENTS_METHOD_NUMBER
The method number for the "getToRecipients" method. |
static Method[] |
MAIL_MESSAGE_VARIABLE_METHODS
The set of methods associated with mail message variables. |
static java.lang.String |
MAIL_MESSAGE_VARIABLE_TYPE
The name that will be used for the data type of mail message variables. |
static java.lang.String |
SET_SENDER_METHOD_NAME
The name of the method that can be used to specify the address of the sender for this message. |
static int |
SET_SENDER_METHOD_NUMBER
The method number for the "setSender" message. |
static java.lang.String |
SET_SUBJECT_METHOD_NAME
The name of the method that can be used to specify the subject for this message. |
static int |
SET_SUBJECT_METHOD_NUMBER
The method number for the "setSubject" message. |
| Constructor Summary | |
MailMessageVariable()
Creates a new variable with no name, to be used only when creating a variable with Class.newInstance(), and only when
setName() is called after that to set the name. |
|
| Method Summary | |
void |
addBodyLine(java.lang.String line)
Adds the specified line to the body for this message. |
void |
addCCRecipient(java.lang.String address)
Adds the specified address to the list of CC recipients for this message. |
void |
addHeaderLine(java.lang.String line)
Adds the specified line to the list of headers for this message. |
void |
addToRecipient(java.lang.String address)
Adds the specified address to the list of To recipients for this message. |
void |
assign(Argument argument)
Assigns the value of the provided argument to this variable. |
void |
clear()
Clears the contents of this message. |
void |
clearBody()
Clears the body of this message. |
void |
clearHeader()
Clears the header of this message. |
Variable |
executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
Executes the specified method, using the provided variables as arguments to the method, and makes the return value available to the caller. |
java.util.ArrayList |
getBodyLines()
Retrieves the lines that make up the body of this message. |
java.util.ArrayList |
getCCList()
Retrieves the list of CC recipients for this message. |
java.util.ArrayList |
getHeaderLines()
Retrieves the lines that make up the header of this message. |
int |
getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the method number for the method that has the specified name and argument types, or -1 if there is no such method. |
Method[] |
getMethods()
Retrieves a list of all methods defined for this variable. |
java.lang.String[] |
getRecipients()
Retrieves an array with all recipients (both To and CC) for this message. |
java.lang.String |
getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the return type for the method with the specified name and argument types. |
java.lang.String |
getSender()
Retrieves the address of the sender for this message. |
java.lang.String |
getSubject()
Retrieves the subject for this message. |
java.util.ArrayList |
getToList()
Retrieves the list of To recipients for this message. |
java.lang.String |
getValueAsString()
Retrieves a string representation of the value of this argument. |
java.lang.String |
getVariableTypeName()
Retrieves the name of the variable type for this variable. |
boolean |
hasMethod(java.lang.String methodName)
Indicates whether this variable type has a method with the specified name. |
static boolean |
isEmailAddress(java.lang.String stringValue)
Indicates whether the provided string value is a valid e-mail address. |
void |
setSender(java.lang.String sender)
Specifies the sender address for this message. |
void |
setSubject(java.lang.String subject)
Specifies the subject for this message. |
| Methods inherited from class com.sun.slamd.scripting.engine.Variable |
getArgumentAsString, getArgumentType, getArgumentValue, getName, getStatTrackers, isValidIdentifier, setName, startStatTrackers, stopStatTrackers |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String MAIL_MESSAGE_VARIABLE_TYPE
public static final java.lang.String ADD_BODY_LINE_METHOD_NAME
public static final int ADD_BODY_LINE_METHOD_NUMBER
public static final java.lang.String ADD_BODY_LINES_METHOD_NAME
public static final int ADD_BODY_LINES_METHOD_NUMBER
public static final java.lang.String ADD_CC_RECIPIENT_METHOD_NAME
public static final int ADD_CC_RECIPIENT_METHOD_NUMBER
public static final java.lang.String ADD_HEADER_LINE_METHOD_NAME
public static final int ADD_HEADER_LINE_METHOD_NUMBER
public static final java.lang.String ADD_TO_RECIPIENT_METHOD_NAME
public static final int ADD_TO_RECIPIENT_METHOD_NUMBER
public static final java.lang.String ASSIGN_METHOD_NAME
public static final int ASSIGN_METHOD_NUMBER
public static final java.lang.String CLEAR_METHOD_NAME
public static final int CLEAR_METHOD_NUMBER
public static final java.lang.String CLEAR_BODY_METHOD_NAME
public static final int CLEAR_BODY_METHOD_NUMBER
public static final java.lang.String CLEAR_HEADER_METHOD_NAME
public static final int CLEAR_HEADER_METHOD_NUMBER
public static final java.lang.String GET_BODY_LINES_METHOD_NAME
public static final int GET_BODY_LINES_METHOD_NUMBER
public static final java.lang.String GET_CC_RECIPIENTS_METHOD_NAME
public static final int GET_CC_RECIPIENTS_METHOD_NUMBER
public static final java.lang.String GET_HEADER_METHOD_NAME
public static final int GET_HEADER_METHOD_NUMBER
public static final java.lang.String GET_HEADER_LINES_METHOD_NAME
public static final int GET_HEADER_LINES_METHOD_NUMBER
public static final java.lang.String GET_SENDER_METHOD_NAME
public static final int GET_SENDER_METHOD_NUMBER
public static final java.lang.String GET_SUBJECT_METHOD_NAME
public static final int GET_SUBJECT_METHOD_NUMBER
public static final java.lang.String GET_TO_RECIPIENTS_METHOD_NAME
public static final int GET_TO_RECIPIENTS_METHOD_NUMBER
public static final java.lang.String SET_SENDER_METHOD_NAME
public static final int SET_SENDER_METHOD_NUMBER
public static final java.lang.String SET_SUBJECT_METHOD_NAME
public static final int SET_SUBJECT_METHOD_NUMBER
public static final Method[] MAIL_MESSAGE_VARIABLE_METHODS
| Constructor Detail |
public MailMessageVariable()
throws ScriptException
Class.newInstance(), and only when
setName() is called after that to set the name.
ScriptException - If a problem occurs while initializing the new
variable.| Method Detail |
public java.lang.String getVariableTypeName()
getVariableTypeName in class Variablepublic void clear()
public void clearBody()
public void clearHeader()
public void addHeaderLine(java.lang.String line)
line - The line to add to the list of headers for this message.public static boolean isEmailAddress(java.lang.String stringValue)
stringValue - The string value for which to make the determination.
true if the provided string does represent a valid
e-mail address, or false if not.public void addBodyLine(java.lang.String line)
line - The line to add to the body of this message.public java.util.ArrayList getCCList()
public void addCCRecipient(java.lang.String address)
address - The address to add to the list of CC recipients for this
message.public java.util.ArrayList getToList()
public void addToRecipient(java.lang.String address)
address - The address to add to the list of To recipients for this
message.public java.lang.String[] getRecipients()
public java.lang.String getSender()
public void setSender(java.lang.String sender)
sender - The sender address to use for the message.public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
subject - The subject to use for the message.public java.util.ArrayList getHeaderLines()
public java.util.ArrayList getBodyLines()
public Method[] getMethods()
getMethods in class Variablepublic boolean hasMethod(java.lang.String methodName)
hasMethod in class VariablemethodName - The name of the method.
true if this variable has a method with the specified
name, or false if it does not.
public int getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
getMethodNumber in class VariablemethodName - The name of the method.argumentTypes - The list of argument types for the method.
public java.lang.String getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
getReturnTypeForMethod in class VariablemethodName - The name of the method.argumentTypes - The set of argument types for the method.
null if there is
no such method defined.
public Variable executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
throws ScriptException
executeMethod in class VariablelineNumber - The line number of the script in which the method
call occurs.methodNumber - The method number of the method to execute.arguments - The set of arguments to use for the method.
null if it
does not return a value.
ScriptException - If the specified method does not exist, or if a
problem occurs while attempting to execute it.
public void assign(Argument argument)
throws ScriptException
assign in class Variableargument - The argument whose value should be assigned to this
variable.
ScriptException - If a problem occurs while performing the
assignment.public java.lang.String getValueAsString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||