Index: trunk/.classpath
===================================================================
--- trunk/.classpath	(revision 2)
+++ trunk/.classpath	(revision 2)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<classpath>
+  <classpathentry excluding="" kind="src" path="src">
+  </classpathentry>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
+  </classpathentry>
+  <classpathentry kind="output" path="target/classes">
+  </classpathentry>
+</classpath>
Index: trunk/.cvsignore
===================================================================
--- trunk/.cvsignore	(revision 2)
+++ trunk/.cvsignore	(revision 2)
@@ -0,0 +1,1 @@
+target
Index: trunk/.project
===================================================================
--- trunk/.project	(revision 2)
+++ trunk/.project	(revision 2)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<projectDescription>
+  <name>accesslib</name>
+  <comment>Abtracts away accessing things.</comment>
+  <projects>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+      <arguments>
+      </arguments>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
Index: trunk/project.xml
===================================================================
--- trunk/project.xml	(revision 2)
+++ trunk/project.xml	(revision 2)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<project>
+  <pomVersion>3</pomVersion>
+  <id>accesslib</id>
+  <name>Accessor Library</name>
+  <!-- The version of the project under development, e.g.
+       1.1, 1.2, 2.0-SNAPSHOT -->
+  <currentVersion>1.0</currentVersion>
+  <!-- details about the organization that 'owns' the project -->
+  <organization>
+    <name>David Owen</name>
+    <url>http://www.fugue88.ws/</url>
+  </organization>
+  <inceptionYear>2005</inceptionYear>
+  <package>ws.fugue88.access</package>
+  <description>Abtracts away accessing things.</description>
+  <!-- the project home page -->
+  <url>http://maven.apache.org/reference/plugins/examples/</url>
+  <siteAddress>jakarta.apache.org</siteAddress>
+  <siteDirectory>/www/maven.apache.org/reference/plugins/examples/</siteDirectory>
+  <distributionDirectory>/www/maven.apache.org/builds/</distributionDirectory>
+  <!-- the version control repository and http url for online access
+       the connection element has the form:
+       scm:<system>:<system specific connection string> -->
+  <repository>
+    <connection>scm:cvs:ext:devel.home:/srv/cvs:accesslib</connection>
+    <!-- url>http://cvs.apache.org/viewcvs/maven-plugins/examples/</url -->
+  </repository>
+  <developers>
+    <developer>
+      <id>dsowen</id>
+      <name>David Owen</name>
+    </developer>
+  </developers>
+  <build>
+    <sourceDirectory>src</sourceDirectory>
+    <!-- unitTestSourceDirectory>testsrc</unitTestSourceDirectory>
+    <unitTest>
+      <includes>
+        <include>**/*Test.java</include>
+      </includes>
+    </unitTest -->
+  </build>
+</project>
Index: trunk/src/ws/fugue88/access/Accessor.java
===================================================================
--- trunk/src/ws/fugue88/access/Accessor.java	(revision 2)
+++ trunk/src/ws/fugue88/access/Accessor.java	(revision 2)
@@ -0,0 +1,60 @@
+/*
+ * This code is copyright (c) 2005 David Owen.  All rights not explicitly
+ * granted in a license accompanying this file are reserved.
+ *
+ * Created on Aug 2, 2005.
+ */
+package ws.fugue88.access;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Provides parameterized bindings to specific references to objects (not
+ * necessarily to specific objects).
+ * 
+ * @author dsowen
+ */
+public interface Accessor {
+
+	/**
+	 * Returns the natural type of the reference bound by this accessor. This
+	 * should:
+	 * <ul>
+	 * <li>return the same type for every binding to the reference;</li>
+	 * <li>return that type independent of the actual type of the referenced
+	 * object; and,</li>
+	 * <li>return that type even if the reference is currently
+	 * <code>null</code> or non-existent.</li>
+	 * </ul>
+	 * 
+	 * @return
+	 */
+	Class getType();
+
+	/**
+	 * Clears the reference bound by this accessor. For references that may be
+	 * deleted without losing the ability to set it, it should be deleted (e.g.
+	 * the key in a map may be removed).
+	 * 
+	 * @throws InvocationTargetException
+	 */
+	void clearValue() throws InvocationTargetException;
+
+	/**
+	 * Returns the current object to which the reference refers. If the
+	 * reference does not exist, <code>null</code> should be returned.
+	 * 
+	 * @return the current value, or <code>null</code> if no reference
+	 * @throws InvocationTargetException
+	 */
+	Object getValue() throws InvocationTargetException;
+
+	/**
+	 * Sets the reference to refer to the given object. If the reference does
+	 * not exist, it is created.
+	 * 
+	 * @param value
+	 * @throws InvocationTargetException
+	 */
+	void setValue(Object value) throws InvocationTargetException;
+}
Index: trunk/src/ws/fugue88/access/MapAccessor.java
===================================================================
--- trunk/src/ws/fugue88/access/MapAccessor.java	(revision 2)
+++ trunk/src/ws/fugue88/access/MapAccessor.java	(revision 2)
@@ -0,0 +1,56 @@
+/*
+ * This code is copyright (c) 2005 David Owen.  All rights not explicitly
+ * granted in a license accompanying this file are reserved.
+ *
+ * Created on Aug 2, 2005.
+ */
+package ws.fugue88.access;
+
+import java.util.Map;
+
+/**
+ * @author dsowen
+ */
+public class MapAccessor implements Accessor {
+
+	public MapAccessor(final Map map, final Object key, final Class type)
+	{
+		map.getClass();
+		type.getClass();
+
+		_map = map;
+		_key = key;
+		_type = type;
+	}
+
+	public Class getType()
+	{
+		return _type;
+	}
+
+	public void clearValue()
+	{
+		_map.remove(_key);
+	}
+
+	public Object getValue()
+	{
+		return check(_map.get(_key));
+	}
+
+	public void setValue(final Object value)
+	{
+		_map.put(_key, check(value));
+	}
+
+	private Object check(final Object obj)
+	{
+		if(obj != null && !_type.isInstance(obj))
+				throw new ClassCastException();
+		return obj;
+	}
+
+	private final Map _map;
+	private final Object _key;
+	private final Class _type;
+}
