01: package org.gui4j.core.call;
02:
03: import java.util.Map;
04:
05: import org.gui4j.exception.Gui4jUncheckedException;
06:
07: final class Gui4jAccessStatic extends Gui4jAccessImpl {
08: private final Class mClass;
09:
10: Gui4jAccessStatic(ParseCtx parseCtx, String accessPath) {
11: int startIndex = parseCtx.i;
12: startIndex++; // accessPath.charAt(startIndex)=':'
13: int endIndex = accessPath.indexOf('.', startIndex);
14: if (endIndex == -1) {
15: Object[] args = { accessPath, new Integer(startIndex) };
16: throw new Gui4jUncheckedException.ResourceError(parseCtx
17: .getConfigurationName(), parseCtx.getLineNumber(),
18: RESOURCE_ERROR_access_unexpected_end, args);
19: }
20: String aliasName = accessPath.substring(startIndex, endIndex);
21: parseCtx.i = endIndex;
22: mClass = parseCtx.getClassForAliasName(aliasName);
23: if (mClass == null) {
24: Object[] args = { accessPath, aliasName };
25: throw new Gui4jUncheckedException.ResourceError(parseCtx
26: .getConfigurationName(), parseCtx.getLineNumber(),
27: RESOURCE_ERROR_alias_not_defined_in_path, args);
28: }
29: }
30:
31: Class getResultClass() {
32: return mClass;
33: }
34:
35: public boolean isConstant() {
36: return true;
37: }
38:
39: public Object getValue(Object baseInstance, Object this Instance,
40: Map paramMap) {
41: return null;
42: }
43:
44: }
|