01: /*
02: * $Id: Import.java,v 1.6 2002/09/16 08:05:03 jkl Exp $
03: *
04: * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
05: *
06: * Use is subject to license terms, as defined in
07: * Anvil Sofware License, Version 1.1. See LICENSE
08: * file, or http://njet.org/license-1.1.txt
09: */
10: package anvil.script;
11:
12: import anvil.Location;
13: import anvil.ErrorListener;
14: import anvil.codec.ClassRoom;
15: import anvil.codec.Code;
16: import anvil.codec.ConstantPool;
17: import anvil.core.Any;
18: import anvil.core.runtime.AnyScope;
19: import anvil.doc.Doc;
20: import anvil.java.util.BindingEnumeration;
21: import anvil.script.compiler.ByteCompiler;
22: import anvil.server.Address;
23: import java.io.IOException;
24: import java.lang.reflect.Field;
25: import java.util.Enumeration;
26:
27: /**
28: * class Import
29: *
30: * @author: Jani Lehtimäki
31: */
32: public class Import {
33:
34: protected Name _name;
35: protected String _as;
36: protected Address _address;
37: protected Ref _ref;
38: protected Location _location;
39: protected Name[] _decls;
40: protected boolean _withstar;
41:
42: public Import(Address address, Location location, Name name,
43: Ref ref, String as, Name[] decls, boolean withstar) {
44: _address = address;
45: _location = location;
46: _name = name;
47: _as = as;
48: _ref = ref;
49: _decls = decls;
50: _withstar = withstar;
51: }
52:
53: public Name getName() {
54: return _name;
55: }
56:
57: public String getAs() {
58: return _as;
59: }
60:
61: public Object getSource() {
62: return _ref;
63: }
64:
65: public Address getAddress() {
66: return _address;
67: }
68:
69: public Location getLocation() {
70: return _location;
71: }
72:
73: public Name[] getDeclarations() {
74: return _decls;
75: }
76:
77: public boolean importAll() {
78: return _withstar;
79: }
80:
81: public Type resolve(ErrorListener listener) {
82: if (_ref.resolve(listener)) {
83: return _ref.getType();
84: } else {
85: return null;
86: }
87: }
88:
89: }
|