com.xpn.xwiki.plugin.applicationmanager.core.api
Class XWikiExceptionApi

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.plugin.applicationmanager.core.api.XWikiExceptionApi

public class XWikiExceptionApi
extends Api

Permit to manipulate XWikiException in velocity code.

Version:
$Id: 87ca83da29474b71682ddc008f792748a3465ccd $

Field Summary
static int ERROR_NOERROR
          No error.
static int ERROR_XWIKI_ERROR_DOES_NOT_EXIST
          Error code that is used when requested error code does not exists.
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Constructor Summary
XWikiExceptionApi(XWikiException exception, XWikiContext context)
          XWikiExceptionApi constructor.
 
Method Summary
 int get(String error)
          Get static field error code value.
 String toString()
           
 
Methods inherited from class com.xpn.xwiki.api.Api
convert, convert, convert, convertAttachments, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_NOERROR

public static final int ERROR_NOERROR
No error.

See Also:
Constant Field Values

ERROR_XWIKI_ERROR_DOES_NOT_EXIST

public static final int ERROR_XWIKI_ERROR_DOES_NOT_EXIST
Error code that is used when requested error code does not exists.

See Also:
Constant Field Values
Constructor Detail

XWikiExceptionApi

public XWikiExceptionApi(XWikiException exception,
                         XWikiContext context)
XWikiExceptionApi constructor.

Parameters:
exception - the XWiki exception to manage.
context - the XWiki context.
Method Detail

toString

public String toString()
Overrides:
toString in class Object

get

public int get(String error)
        throws XWikiException
Get static field error code value. This name targeting velocity to be able to use like "exception.SOME_ERROR_CODE".

Parameters:
error - the static field name.
Returns:
the static field value.
Throws:
XWikiException - ERROR_XWIKI_ERROR_DOES_NOT_EXIST No corresponding error code exist.


Copyright © 2004-2013 XWiki. All Rights Reserved.