01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.client.base;
19:
20: public class ComponentReference {
21:
22: private String path, dir, name;
23:
24: private int start;
25:
26: public ComponentReference(ContelligentComponent component) {
27: this .path = component.getPath();
28: this .name = component.getName();
29: this .dir = component.getDir();
30: }
31:
32: public ComponentReference(String dir, String name) {
33: this .dir = dir;
34: this .name = name;
35: this .path = dir + "/" + name;
36: }
37:
38: public ContelligentComponent getComponent()
39: throws ComponentNotFoundException {
40: return ComponentFactory.getInstance().getComponent(path);
41: }
42:
43: public String getPath() {
44: return path;
45: }
46:
47: public String getDir() {
48: return dir;
49: }
50:
51: public String getName() {
52: return name;
53: }
54:
55: public String toString() {
56: if (name.equals("")) {
57: return "/";
58: }
59: return name;
60: }
61:
62: public void setStart(int start) {
63: this .start = start;
64: }
65:
66: public int getStart() {
67: return start;
68: }
69: }
|