|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.keel.comm.ModelResponseMessage
| Field Summary | |
private java.util.Map |
attributes |
private java.util.List |
elementList |
private java.util.Map |
elementsMap of the ResponseElement entries this response contains |
private short |
errorDupCount |
private java.util.Map |
errors |
private java.util.Map |
errorTypes |
private ModelResponse |
originalRes |
private static java.lang.String |
PREFIX |
private java.util.Map |
stackTraces |
| Fields inherited from interface org.keel.services.model.ModelResponse |
ROLE |
| Constructor Summary | |
ModelResponseMessage() |
|
| Method Summary | |
void |
add(ResponseElement re)The Model (only) uses the method below to add new response elements to this response. |
void |
addCommand(java.lang.String model, java.lang.String label)Convenience add method for creating a simple command If you need to specify additional information about the command, such as parameters use createCommand, populate the object, then use add. |
void |
addError(java.lang.String errorName, java.lang.String errorMessage)Add an error with a specific name. |
void |
addError(java.lang.String errorName, java.lang.String errorMessage, java.lang.Throwable t)Just like addError above, but including an actual throwable with details about the error |
void |
addError(java.lang.String errorName, java.lang.Throwable t)Just like addError above, but including a throwable but no message. |
void |
addErrors(java.util.Map newErrors)Deprecated. This method doesn't support sending the stack trace with the error, which is usually very helpful. Use addError instead for each error. |
void |
addInput(java.lang.String name, java.lang.String label)Convenience add method for creating a simple input. |
void |
addOutput(java.lang.String content)Convenience add method for creating a simple string output with a name assigned by the ModelResponse |
void |
addOutput(java.lang.String name, java.lang.String content)Convenience add method for creating a simple string output with a specific name |
void |
addThrowables(java.util.Map m) |
void |
clearErrors()Clear the current errors Map |
void |
copyFrom(ModelResponse res) |
Command |
createCommand(java.lang.String model)Create a Command with the specified name |
Command |
createCommandRelativeSequence(int numberOfSteps) |
Input |
createInput(java.lang.String name)Create an Input with the specified name |
Output |
createOutput(java.lang.String name)Create an Output with the specified name |
Output |
createOutput(java.lang.String name, java.lang.String content)Create an output with the specified name and content |
KeelResponse |
deserialize(byte[] bytes) |
ResponseElement |
get(java.lang.String elementLocator)Return a specific element |
java.util.Iterator |
getAll()Return an iterator over all of the ResponseElements in this response |
java.lang.Object |
getAttribute(java.lang.String key) |
java.util.Map |
getAttributes() |
java.util.Map |
getErrors()Return a map of error names and error messages. |
java.lang.String |
getErrorType(java.lang.String errorName)Get the type of the specified error, where the type is the classname of the exception contained in the error. |
java.lang.String |
getStackTrace(java.lang.String errorName)If there is a stack trace related to the error, it can be accessed via this method. |
java.lang.Throwable |
getThrowable(java.lang.String oneKey)We don't store the actual Throwable in a ModelRequestMessage, only the stacktrace. |
private void |
notImplemented() |
void |
remove(ResponseElement re)Remove a specific element |
void |
removeAttribute(java.lang.String key) |
byte[] |
serialize() |
void |
setAttribute(java.lang.String key, java.lang.Object value)Set the value of an attribute of this response |
void |
setDefaultsFromPrevious()This method is used to facilitate a "repeat request" where the default values of Inputs are set from the values entered in the previous request by the user. |
void |
setRequest(ModelRequest req)Used *only* by the ModelRequest to associate the originating request with the response. |
java.lang.String |
toString()toString for a ModelRequestMessage just passes the request on to the underlying ModelRequest. |
private java.lang.String |
uniqueErrorName(java.lang.String errorName) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.util.Map attributes
private transient short errorDupCount
private static java.lang.String PREFIX
private java.util.Map elements
private java.util.List elementList
private java.util.Map errors
private java.util.Map errorTypes
private java.util.Map stackTraces
private transient ModelResponse originalRes
| Constructor Detail |
public ModelResponseMessage()
| Method Detail |
public void removeAttribute(java.lang.String key)
removeAttribute in interface KeelResponse
public void addOutput(java.lang.String name,
java.lang.String content)
throws ModelException
KeelResponseaddOutput in interface KeelResponseModelExceptionprivate void notImplemented()
public void addOutput(java.lang.String content)
throws ModelException
KeelResponseaddOutput in interface KeelResponseModelException
public Output createOutput(java.lang.String name)
throws ModelException
KeelResponsecreateOutput in interface KeelResponseModelException
public Output createOutput(java.lang.String name,
java.lang.String content)
throws ModelException
KeelResponsecreateOutput in interface KeelResponseModelException
public Input createInput(java.lang.String name)
throws ModelException
KeelResponsecreateInput in interface KeelResponseModelException
public void addInput(java.lang.String name,
java.lang.String label)
throws ModelException
KeelResponseaddInput in interface KeelResponseModelException
public Command createCommand(java.lang.String model)
throws ModelException
KeelResponsecreateCommand in interface KeelResponseModelException
public Command createCommandRelativeSequence(int numberOfSteps)
throws ModelException
createCommandRelativeSequence in interface KeelResponseModelException
public void addCommand(java.lang.String model,
java.lang.String label)
throws ModelException
KeelResponseaddCommand in interface KeelResponseModelExceptionpublic ResponseElement get(java.lang.String elementLocator)
get in interface KeelResponsepublic void remove(ResponseElement re)
remove in interface KeelResponsepublic java.util.Iterator getAll()
getAll in interface KeelResponse
public void add(ResponseElement re)
throws ModelException
add in interface KeelResponseModelExceptionprivate java.lang.String uniqueErrorName(java.lang.String errorName)
public void addError(java.lang.String errorName,
java.lang.String errorMessage)
KeelResponseaddError in interface KeelResponseerrorName - A name for this error message, which may (or may not) correspond to the UI element from which the error originated.errorMessage - A human-readable error message to be displayed to the user. Messages beginning with "$" will be taken to be internationalized keys to look up in the appropriate message bundle for this locale.
public void addError(java.lang.String errorName,
java.lang.String errorMessage,
java.lang.Throwable t)
KeelResponseaddError in interface KeelResponseerrorName - A name for this error message, which may (or may not) correspond to the UI element from which the error originated.errorMessage - A human-readable error message to be displayed to the user. Messages beginning with "$" will be taken to be internationalized keys to look up in the appropriate message bundle for this locale.t - A Throwable that caused this error to be recorded.
public void addError(java.lang.String errorName,
java.lang.Throwable t)
KeelResponseaddError in interface KeelResponseerrorName - A name for this error message, which may (or may not) correspond to the UI element from which the error originated.t - A Throwable that caused this error to be recorded.public void addErrors(java.util.Map newErrors)
addErrors in interface KeelResponsepublic void clearErrors()
KeelResponseclearErrors in interface KeelResponsepublic java.util.Map getErrors()
KeelResponsegetErrors in interface KeelResponsepublic java.lang.String getErrorType(java.lang.String errorName)
KeelResponsegetErrorType in interface KeelResponseerrorName - Name of the error to be checkedpublic java.lang.String getStackTrace(java.lang.String errorName)
KeelResponsegetStackTrace in interface KeelResponseerrorName - The name of the error, as used when addError logged the error originallypublic void setRequest(ModelRequest req)
KeelResponsesetRequest in interface KeelResponsepublic void setDefaultsFromPrevious()
KeelResponsesetDefaultsFromPrevious in interface KeelResponsepublic void addThrowables(java.util.Map m)
public java.lang.Object getAttribute(java.lang.String key)
getAttribute in interface KeelResponsepublic java.util.Map getAttributes()
getAttributes in interface KeelResponse
public void setAttribute(java.lang.String key,
java.lang.Object value)
KeelResponsesetAttribute in interface KeelResponse
public void copyFrom(ModelResponse res)
throws ModelException
ModelException
public byte[] serialize()
throws java.io.IOException
serialize in interface KeelResponsejava.io.IOException
public KeelResponse deserialize(byte[] bytes)
throws java.io.IOException
deserialize in interface KeelResponsejava.io.IOExceptionpublic java.lang.Throwable getThrowable(java.lang.String oneKey)
getThrowable in interface KeelResponseoneKey - The error message key of the error for which the corresponding Throwable was requested.java.lang.IllegalArgumentException - We don't store the throwables.public java.lang.String toString()
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||