Skip to main content
summaryrefslogtreecommitdiffstats
blob: 7005354b5a668c21c19e403df6c2d67ee531edf6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*******************************************************************************
 * Copyright (c) 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*


 */
package org.eclipse.jem.internal.proxy.initParser.tree;
 

/**
 * The expression (or some nested expression) did not return a value. I.e. it was <code>void</code>.
 * This would occur only if the value of expression was being retrieved through getExpressionValue,
 * or if a nested expression was used, since in that case the value would of been used as an
 * argument or receiver to another expression.
 * 
 * @since 1.0.0
 */
public class NoExpressionValueException extends Exception {
	
	/**
	 * Comment for <code>serialVersionUID</code>
	 * 
	 * @since 1.1.0
	 */
	private static final long serialVersionUID = -7953101867782417964L;
	
	private InternalExpressionProxy proxy;

	/**
	 * Construct with no arguments.
	 * 
	 * @since 1.0.0
	 */
	public NoExpressionValueException() {
		super();
	}
	
	public NoExpressionValueException(Throwable e) {
		super(e);
	}

	/**
	 * Construct with a message.
	 * 
	 * @param message
	 * 
	 * @since 1.0.0
	 */
	public NoExpressionValueException(String message) {
		this(message, null);
	}
	
	/**
	 * Construct with a message and a proxy. This is only used from {@link ExpressionProcesser#getExpressionProxyValue(int, Object[])} when
	 * the proxy existed but it was not set.
	 * 
	 * @param message
	 * @param proxy
	 * 
	 * @since 1.1.0
	 */
	public NoExpressionValueException(String message, InternalExpressionProxy proxy) {
		super (message);
		this.proxy = proxy;
	}
	
	/**
	 * Get the proxy if there is one. It will be a proxy if {@link ExpressionProcesser#getExpressionProxyValue(int, Object[])}
	 * was for an existing proxy but that proxy was not set. Otherwise it will be null. This is here for callers to
	 * put special info in the proxy for the not set condition and report better info.
	 * 
	 * @return the proxy (if not set) or <code>null</code> if no proxy available.
	 * 
	 * @since 1.1.0
	 */
	public InternalExpressionProxy getProxy() {
		return proxy;
	}
}

Back to the top