// Path: traction/src/main/java/traction/mvc/implementations/CommandArgument.java
// public class CommandArgument
// {
//     private String commandName;
//     private boolean eventCancelled;
//     private JSONObject tagProperties;
// 
//     public boolean isEventCancelled()
//     {
//         return eventCancelled;
//     }
// 
//     public void setEventCancelled(boolean isCancelled)
//     {
//         eventCancelled = isCancelled;
//     }
// 
//     public CommandArgument(String commandName)
//     {
//         this(commandName, null);
//     }
// 
//     public CommandArgument(String commandName, JSONObject tagProperties)
//     {
//         this.commandName = commandName;
//         this.eventCancelled = false;
//         this.tagProperties = tagProperties;
//     }
// 
//     public JSONObject getEventData()
//     {
//         return tagProperties;
//     }
// 
//     public String getCommandName()
//     {
//         return commandName;
//     }
// }
// 
// Path: traction/src/main/java/traction/mvc/implementations/PathBinding.java
// public class PathBinding
// {
// 	private final ArrayList<IUIElement<?>> uiElements = new ArrayList<IUIElement<?>>();
// 
// 	/**
// 	 * Adds a ui element to the Path biding
// 	 * @param element
// 	 */
// 	public void addUIElement(IUIElement<?> element)
// 	{
// 		uiElements.add(element);
// 	}	
// 	
// 	/**
// 	 * Gets all ui elements tracked to this path so far
// 	 * @return
// 	 */
// 	public ArrayList<IUIElement<?>> getUIElements()
// 	{
// 		return uiElements;
// 	}
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IPropertyStore.java
// public interface IPropertyStore
// {
//     Property<?,?> getProperty(String name);
// }
// 
// 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/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/interfaces/IUIElement.java
// public interface IUIElement<T>
// {
// 	/**
// 	 * sets a handler for when the ui recieves data from the model/view-model
// 	 * @param listener
// 	 */
// 	public void setUIUpdateListener(IUIUpdateListener<T> listener);
// 
// 	/**
// 	 * Sends data to the ui element. Expects the IUIUpdateListener to be called 
// 	 * @param value
// 	 */
// 	public void receiveUpdate(final Object value);
// 	
// 	/**
// 	 * Sends data from ui back to model/view-model
// 	 * @param value
// 	 */
// 	public void sendUpdate(T value);
// 
// 	/**
// 	 * Initializes data for ui element during inflation
// 	 */
// 	public void initialize() throws Exception;
// 
// 	/**
// 	 * gets the binding inventory the ui element is associated to
// 	 * @return
// 	 */
// 	public BindingInventory getBindingInventory();
// 
// 	/**
// 	 * listener to handle updates to the ui element
// 	 * @author Tim Stratton
// 	 *
// 	 * @param <S> : type of data sent to ui element
// 	 */
// 	public interface IUIUpdateListener<S>
// 	{
// 		public void onUpdate(S value);
// 	}
// 
//     public boolean isDefined();
// 
//     public void track(BindingInventory differentBindingInventory);
// }


import traction.mvc.interfaces.IUIElement;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.NavigableMap;
import java.util.Set;
import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.util.Property;
import traction.mvc.implementations.CommandArgument;
import traction.mvc.implementations.PathBinding;
import traction.mvc.interfaces.IPropertyStore;
import traction.mvc.interfaces.IObservableCommand;
import traction.mvc.interfaces.IPOJO;
	}

	@SuppressWarnings("unchecked")
    public Class<?> dereferencePropertyType(String path)
	{
        if (path == null)
            return null;

		if (path != null && path.equals("."))
			return context.getProxyObservableObject().getSource() == null ? null : context.getProxyObservableObject().getSource().getClass();
		
		Matcher matches = pathPattern.matcher(path);
		if (!matches.find())
			return null;
		
		BindingInventory currentInventory = getInventoryByMatchedPattern(matches);
				
		Object currentContext = currentInventory.extractSource();

		String[] chains = split.split(matches.group(2));
		
		Property<Object,Object> prop = null;
		
		 for(int i=0;i<chains.length;i++)
		 { 		
			 if (currentContext == null)
				 return null;
			 String member = chains[i];

             if (currentContext instanceof IPOJO)
// Path: traction/src/main/java/traction/mvc/implementations/CommandArgument.java
// public class CommandArgument
// {
//     private String commandName;
//     private boolean eventCancelled;
//     private JSONObject tagProperties;
// 
//     public boolean isEventCancelled()
//     {
//         return eventCancelled;
//     }
// 
//     public void setEventCancelled(boolean isCancelled)
//     {
//         eventCancelled = isCancelled;
//     }
// 
//     public CommandArgument(String commandName)
//     {
//         this(commandName, null);
//     }
// 
//     public CommandArgument(String commandName, JSONObject tagProperties)
//     {
//         this.commandName = commandName;
//         this.eventCancelled = false;
//         this.tagProperties = tagProperties;
//     }
// 
//     public JSONObject getEventData()
//     {
//         return tagProperties;
//     }
// 
//     public String getCommandName()
//     {
//         return commandName;
//     }
// }
// 
// Path: traction/src/main/java/traction/mvc/implementations/PathBinding.java
// public class PathBinding
// {
// 	private final ArrayList<IUIElement<?>> uiElements = new ArrayList<IUIElement<?>>();
// 
// 	/**
// 	 * Adds a ui element to the Path biding
// 	 * @param element
// 	 */
// 	public void addUIElement(IUIElement<?> element)
// 	{
// 		uiElements.add(element);
// 	}	
// 	
// 	/**
// 	 * Gets all ui elements tracked to this path so far
// 	 * @return
// 	 */
// 	public ArrayList<IUIElement<?>> getUIElements()
// 	{
// 		return uiElements;
// 	}
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IPropertyStore.java
// public interface IPropertyStore
// {
//     Property<?,?> getProperty(String name);
// }
// 
// 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/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/interfaces/IUIElement.java
// public interface IUIElement<T>
// {
// 	/**
// 	 * sets a handler for when the ui recieves data from the model/view-model
// 	 * @param listener
// 	 */
// 	public void setUIUpdateListener(IUIUpdateListener<T> listener);
// 
// 	/**
// 	 * Sends data to the ui element. Expects the IUIUpdateListener to be called 
// 	 * @param value
// 	 */
// 	public void receiveUpdate(final Object value);
// 	
// 	/**
// 	 * Sends data from ui back to model/view-model
// 	 * @param value
// 	 */
// 	public void sendUpdate(T value);
// 
// 	/**
// 	 * Initializes data for ui element during inflation
// 	 */
// 	public void initialize() throws Exception;
// 
// 	/**
// 	 * gets the binding inventory the ui element is associated to
// 	 * @return
// 	 */
// 	public BindingInventory getBindingInventory();
// 
// 	/**
// 	 * listener to handle updates to the ui element
// 	 * @author Tim Stratton
// 	 *
// 	 * @param <S> : type of data sent to ui element
// 	 */
// 	public interface IUIUpdateListener<S>
// 	{
// 		public void onUpdate(S value);
// 	}
// 
//     public boolean isDefined();
// 
//     public void track(BindingInventory differentBindingInventory);
// }


// Path: traction/src/main/java/traction/mvc/observables/BindingInventory.java
import traction.mvc.interfaces.IUIElement;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.NavigableMap;
import java.util.Set;
import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.util.Property;
import traction.mvc.implementations.CommandArgument;
import traction.mvc.implementations.PathBinding;
import traction.mvc.interfaces.IPropertyStore;
import traction.mvc.interfaces.IObservableCommand;
import traction.mvc.interfaces.IPOJO;

	}

	@SuppressWarnings("unchecked")
    public Class<?> dereferencePropertyType(String path)
	{
        if (path == null)
            return null;

		if (path != null && path.equals("."))
			return context.getProxyObservableObject().getSource() == null ? null : context.getProxyObservableObject().getSource().getClass();
		
		Matcher matches = pathPattern.matcher(path);
		if (!matches.find())
			return null;
		
		BindingInventory currentInventory = getInventoryByMatchedPattern(matches);
				
		Object currentContext = currentInventory.extractSource();

		String[] chains = split.split(matches.group(2));
		
		Property<Object,Object> prop = null;
		
		 for(int i=0;i<chains.length;i++)
		 { 		
			 if (currentContext == null)
				 return null;
			 String member = chains[i];

             if (currentContext instanceof IPOJO)
                 prop = ((IPOJO)currentContext).getProperty(member);