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.domutil;
15:
16: import org.itsnat.core.domutil.ElementTableStructure;
17: import org.itsnat.core.domutil.ElementTable;
18: import org.itsnat.impl.core.util.*;
19: import org.w3c.dom.Element;
20:
21: /**
22:
23: * @author jmarranz
24: */
25: public class ElementTableStructureDefaultImpl implements
26: ElementTableStructure {
27: public static final ElementTableStructureDefaultImpl SINGLETON = new ElementTableStructureDefaultImpl();
28:
29: /**
30: * Creates a new instance of ElementListStructureDefaultImpl
31: */
32: private ElementTableStructureDefaultImpl() {
33: }
34:
35: public static ElementTableStructureDefaultImpl newElementTableStructureDefault() {
36: // A día de hoy no se guarda estado por lo que el SINGLETON ayuda a disminuir el número de objetos
37: return SINGLETON;
38: }
39:
40: public static Element getRowContentElement(int row, Element rowElem) {
41: return rowElem;
42: }
43:
44: public static Element getCellContentElement(int row, int col,
45: Element cellElem) {
46: return cellElem;
47: }
48:
49: public Element getRowContentElement(ElementTable table, int row,
50: Element rowElem) {
51: if (rowElem == null)
52: rowElem = table.getRowElementAt(row);
53: return getRowContentElement(row, rowElem);
54: }
55:
56: public Element getCellContentElement(ElementTable table, int row,
57: int col, Element cellElem) {
58: if (cellElem == null)
59: cellElem = table.getCellElementAt(row, col);
60: return getCellContentElement(row, col, cellElem);
61: }
62:
63: }
|