01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.impl.core;
15:
16: import org.itsnat.impl.core.js.domrender.node.JSNodeRenderImpl;
17:
18: /**
19: *
20: * @author jmarranz
21: */
22: public class NodeLocation {
23: protected String parentId;
24: protected String id;
25: protected String path;
26:
27: /** Creates a new instance of NodeLocation */
28: public NodeLocation(String parentId, String id, String path) {
29: this .parentId = parentId;
30: this .id = id;
31: this .path = path;
32: }
33:
34: private boolean isNull(String str) {
35: return ((str == null) || str.equals("null"));
36: }
37:
38: public boolean isAlreadyCached() {
39: return !isNull(id) && isNull(parentId) && isNull(path);
40: }
41:
42: public String getParentId() {
43: return parentId;
44: }
45:
46: public String getId() {
47: return id;
48: }
49:
50: public String getPath() {
51: return path;
52: }
53:
54: public String getParentIdJS() {
55: return JSNodeRenderImpl.toLiteralStringJS(getParentId());
56: }
57:
58: public String getIdJS() {
59: return JSNodeRenderImpl.toLiteralStringJS(getId());
60: }
61:
62: public String getPathJS() {
63: return JSNodeRenderImpl.toLiteralStringJS(getPath());
64: }
65: }
|