jetbrains.buildServer.controllers
Class ActionErrors

java.lang.Object
  extended by jetbrains.buildServer.controllers.ActionErrors

public class ActionErrors
extends java.lang.Object

A storage for various errors that can occur during web controllers execution.


Nested Class Summary
static class ActionErrors.Error
          Represents an error
 
Constructor Summary
ActionErrors()
          Constructs new errors storage
 
Method Summary
 void addAll(ActionErrors errors)
          Adds all of the errors from the specified errors storage to this storage
 void addError(InvalidProperty ip)
          Adds an error with specified id and error message to this storage.
 void addError(java.lang.String id, java.lang.String message)
          Adds an error with specified id and error message to this storage.
 void fillErrors(PropertiesProcessor processor, java.util.Map<java.lang.String,java.lang.String> properties)
          Fills this errors storage from the invalid properties returned by PropertiesProcessor TODO: move this method out of web openapi
 ActionErrors.Error findErrorById(java.lang.String id)
          Searches for an error by specified id
 java.util.List<ActionErrors.Error> getErrors()
          Returns list of errors containing in this errors storage.
 boolean hasErrors()
          Returns true if this storage contains at least one error.
 boolean hasNoErrors()
          Returns true if this storage does not contain errors
 void serialize(org.jdom.Element rootElement)
          Serializes errors containing in this storage into the specified XML document.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActionErrors

public ActionErrors()
Constructs new errors storage

Method Detail

addError

public void addError(@NotNull
                     java.lang.String id,
                     @Nullable
                     java.lang.String message)
Adds an error with specified id and error message to this storage.

Parameters:
id - id of the error
message - error message

addError

public void addError(@NotNull
                     InvalidProperty ip)
Adds an error with specified id and error message to this storage.

Since:
8.0

addAll

public void addAll(@NotNull
                   ActionErrors errors)
Adds all of the errors from the specified errors storage to this storage

Parameters:
errors - errors storage

getErrors

@NotNull
public java.util.List<ActionErrors.Error> getErrors()
Returns list of errors containing in this errors storage.

Returns:
list of errors

findErrorById

@Nullable
public ActionErrors.Error findErrorById(@NotNull
                                                 java.lang.String id)
Searches for an error by specified id

Parameters:
id - id of the error
Returns:
an error or null

hasErrors

public boolean hasErrors()
Returns true if this storage contains at least one error.

Returns:
true if this storage contains at least one error.

hasNoErrors

public boolean hasNoErrors()
Returns true if this storage does not contain errors

Returns:
true if this storage does not contain errors

serialize

public void serialize(@NotNull
                      org.jdom.Element rootElement)
Serializes errors containing in this storage into the specified XML document. Errors document structure:
 <errors>
    <error id="{error id}">{error message}</error>
 </errors>
 

Parameters:
rootElement - element where the errors should be attached See javascript: BS.Util.xmlErrors

fillErrors

public void fillErrors(@Nullable
                       PropertiesProcessor processor,
                       @NotNull
                       java.util.Map<java.lang.String,java.lang.String> properties)
Fills this errors storage from the invalid properties returned by PropertiesProcessor TODO: move this method out of web openapi

Parameters:
processor - properties processor
properties - properties to check

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object