// Path: traction/src/main/java/traction/mvc/interfaces/IObservableCommand.java
// public interface IObservableCommand
// extends IObservableObject
// {
//     /**
//      * call to execute command
//      * @param arg
//      */
//     void execute(CommandArgument arg);
// 
//     void setExecuteListener(IOnExecuteListener listener);
// 
//     /**
//      *
//      * @return : true if command can execute
//      */
//     boolean getCanExecute();
// 
//     /**
//      * set whether command can execute
//      * @param b
//      */
//     void setCanExecute(boolean b);
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IObservableCursor.java
// public interface IObservableCursor
//     extends LoaderManager.LoaderCallbacks<Cursor>,IProxyObservableObject, ITemplateAdapter
// {
//     void setLoader(Loader<Cursor> loader);
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IPOJO.java
// public interface IPOJO
// {
//     /**
//      * Access property from property store.
//      * @param name
//      * @return if property exists, return property object, or null if not found
//      */
//     Property<Object,Object> getProperty(String name);
// }


import android.util.Property;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Collection;
import java.util.Hashtable;
import java.util.LinkedList;
import traction.mvc.interfaces.IObservableCommand;
import traction.mvc.interfaces.IObservableCursor;
import traction.mvc.interfaces.IPOJO;
            }
            else if (IPOJO.class == method.getDeclaringClass())
            {
                if (!name.equals("getProperty"))
                    throw new IllegalStateException("only 'getProperty' may be called on 'IPOJO'.");
                return map.getProperty((String)args[1]);
            }


            if (method.getReturnType().equals(Void.TYPE))//set
            {
                map.put(name.substring(3), args[0]);
                return null;
            }
            else//get
            {
                name = name.substring(method.getName().startsWith("is") ? 2 : 3);
                Property<?,?> prop = Property.of(proxy.getClass(), method.getReturnType(), name);
                if (prop.isReadOnly() && map.get(name) == null)
                {
                    if (Collection.class.isAssignableFrom(method.getReturnType()) ||
                    Iterable.class.isAssignableFrom(method.getReturnType()))
                    {
                        ObservableList<Object> list = new ObservableList<Object>(new LinkedList<Object>());
                        map.put(name, list);
                    }
                    else if (IObservableCursor.class.isAssignableFrom(method.getReturnType()))
                    {
                        map.put(name, new ObservableCursor());
                    }
// Path: traction/src/main/java/traction/mvc/interfaces/IObservableCommand.java
// public interface IObservableCommand
// extends IObservableObject
// {
//     /**
//      * call to execute command
//      * @param arg
//      */
//     void execute(CommandArgument arg);
// 
//     void setExecuteListener(IOnExecuteListener listener);
// 
//     /**
//      *
//      * @return : true if command can execute
//      */
//     boolean getCanExecute();
// 
//     /**
//      * set whether command can execute
//      * @param b
//      */
//     void setCanExecute(boolean b);
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IObservableCursor.java
// public interface IObservableCursor
//     extends LoaderManager.LoaderCallbacks<Cursor>,IProxyObservableObject, ITemplateAdapter
// {
//     void setLoader(Loader<Cursor> loader);
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IPOJO.java
// public interface IPOJO
// {
//     /**
//      * Access property from property store.
//      * @param name
//      * @return if property exists, return property object, or null if not found
//      */
//     Property<Object,Object> getProperty(String name);
// }


// Path: traction/src/main/java/traction/mvc/observables/ScopeBuilder.java
import android.util.Property;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Collection;
import java.util.Hashtable;
import java.util.LinkedList;
import traction.mvc.interfaces.IObservableCommand;
import traction.mvc.interfaces.IObservableCursor;
import traction.mvc.interfaces.IPOJO;

            }
            else if (IPOJO.class == method.getDeclaringClass())
            {
                if (!name.equals("getProperty"))
                    throw new IllegalStateException("only 'getProperty' may be called on 'IPOJO'.");
                return map.getProperty((String)args[1]);
            }


            if (method.getReturnType().equals(Void.TYPE))//set
            {
                map.put(name.substring(3), args[0]);
                return null;
            }
            else//get
            {
                name = name.substring(method.getName().startsWith("is") ? 2 : 3);
                Property<?,?> prop = Property.of(proxy.getClass(), method.getReturnType(), name);
                if (prop.isReadOnly() && map.get(name) == null)
                {
                    if (Collection.class.isAssignableFrom(method.getReturnType()) ||
                    Iterable.class.isAssignableFrom(method.getReturnType()))
                    {
                        ObservableList<Object> list = new ObservableList<Object>(new LinkedList<Object>());
                        map.put(name, list);
                    }
                    else if (IObservableCursor.class.isAssignableFrom(method.getReturnType()))
                    {
                        map.put(name, new ObservableCursor());
                    }
                    else if (IObservableCommand.class.isAssignableFrom(method.getReturnType()))