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.core.domutil;
15:
16: import org.itsnat.core.ItsNatUserData;
17: import org.w3c.dom.Element;
18:
19: /**
20: * Contains the DOM Element object and index of a child of a DOM element list.
21: *
22: * <p>If the parent list (which this object belongs to) is master, this object is ever the
23: * same instance per list element, supporting index changes (inserting or removing
24: * elements to the list) and DOM element changes (calling {@link ElementListFree#setElementAt(int,org.w3c.dom.Element)} ).
25: * This feature is very interesting to save contextual
26: * data associated to the child element (using {@link ItsNatUserData}).
27: * </p>
28: *
29: * <p>If the parent list is slave every object obtained is a new instance, {@link ItsNatUserData}
30: * can not be used.</p>
31: *
32: * @author Jose Maria Arranz Santamaria
33: * @see ElementListBase#getListElementInfoAt(int)
34: * @see ElementListBase#getListElementInfoFromNode(Node)
35: */
36: public interface ListElementInfo extends ItsNatUserData {
37: /**
38: * Returns the parent list this object belongs to.
39: *
40: * @return the parent list.
41: */
42: public ElementListBase getParentList();
43:
44: /**
45: * Returns the DOM element object parent of this child.
46: *
47: * @return the DOM element.
48: */
49: public Element getElement();
50:
51: /**
52: * Returns the element index.
53: *
54: * @return the element index.
55: */
56: public int getIndex();
57: }
|