source: trunk/src/ws/fugue88/access/Accessor.java

Last change on this file was 3, checked in by dsowen, 21 years ago

Copyright notice fixed.
Added containment accessor.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1/*
2 * This code is copyright (c) 2005 David Owen.  All rights not explicitly
3 * granted by the author are reserved.
4 *
5 * Created on Aug 2, 2005.
6 */
7package ws.fugue88.access;
8
9import java.lang.reflect.InvocationTargetException;
10
11/**
12 * Provides parameterized bindings to specific references to objects (not
13 * necessarily to specific objects).
14 *
15 * @author dsowen
16 */
17public interface Accessor {
18
19        /**
20         * Returns the natural type of the reference bound by this accessor. This
21         * should:
22         * <ul>
23         * <li>return the same type for every binding to the reference;</li>
24         * <li>return that type independent of the actual type of the referenced
25         * object; and,</li>
26         * <li>return that type even if the reference is currently
27         * <code>null</code> or non-existent.</li>
28         * </ul>
29         *
30         * @return
31         */
32        Class getType();
33
34        /**
35         * Clears the reference bound by this accessor. For references that may be
36         * deleted without losing the ability to set it, it should be deleted (e.g.
37         * the key in a map may be removed).
38         *
39         * @throws InvocationTargetException
40         */
41        void clearValue() throws InvocationTargetException;
42
43        /**
44         * Returns the current object to which the reference refers. If the
45         * reference does not exist, <code>null</code> should be returned.
46         *
47         * @return the current value, or <code>null</code> if no reference
48         * @throws InvocationTargetException
49         */
50        Object getValue() throws InvocationTargetException;
51
52        /**
53         * Sets the reference to refer to the given object. If the reference does
54         * not exist, it is created.
55         *
56         * @param value
57         * @throws InvocationTargetException
58         */
59        void setValue(Object value) throws InvocationTargetException;
60}
Note: See TracBrowser for help on using the repository browser.