org.eclipse.emf.ecp.internal.core.util.observer
Class ECPObserverCall.Result

java.lang.Object
  extended by org.eclipse.emf.ecp.internal.core.util.observer.ECPObserverCall.Result
Enclosing interface:
ECPObserverCall

public static class ECPObserverCall.Result
extends Object

This class represents an result from an observer call. It contains the observer, the called method and the result or an exception, if occured.

Author:
wesendon

Constructor Summary
ECPObserverCall.Result(ECPObserver observer, Method method, Object result)
          This constructor is used if NO exception occurred.
ECPObserverCall.Result(ECPObserver observer, Throwable e, Method method)
          This constructor is used if an exception HAS occurred.
 
Method Summary
 boolean exceptionOccurred()
          Specifies whether this Result contains an exception.
static Object getDefaultValue(Method m)
          Returns the default value for a given method.
 Throwable getException()
          .
 ECPObserver getObserver()
          The observer.
 Object getResult()
          The result.
 Object getResultOrDefaultValue()
          Returns the result or the default value for primitive types.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECPObserverCall.Result

public ECPObserverCall.Result(ECPObserver observer,
                              Method method,
                              Object result)
This constructor is used if NO exception occurred.

Parameters:
observer - observer
method - method
result - result

ECPObserverCall.Result

public ECPObserverCall.Result(ECPObserver observer,
                              Throwable e,
                              Method method)
This constructor is used if an exception HAS occurred.

Parameters:
observer - observer
e - exception
method - method
Method Detail

exceptionOccurred

public boolean exceptionOccurred()
Specifies whether this Result contains an exception.

Returns:
boolean

getException

public Throwable getException()
.

Returns:
exception or null

getObserver

public ECPObserver getObserver()
The observer.

Returns:
this can't be null

getResult

public Object getResult()
The result.

Returns:
the result or null

getResultOrDefaultValue

public Object getResultOrDefaultValue()
Returns the result or the default value for primitive types.

Returns:
result, null or in case of primitive type, the default value.

getDefaultValue

public static Object getDefaultValue(Method m)
Returns the default value for a given method. Which is null or the default primitive value.

Parameters:
m - method
Returns:
null or default primitive value


Copyright © 2015. All Rights Reserved.