/// <summary> introspects the class to find the method name of the node, /// or if that fails, treats the reference object as a map /// and treats the identifier as a key in that map. /// This needs work. /// * /// </summary> /// <param name="data">Class to be introspected /// /// </param> private AbstractExecutor doIntrospection(System.Type data) { AbstractExecutor executor; /* * first try for a getFoo() type of property * (also getfoo() ) */ executor = new PropertyExecutor(rsvc, data, identifier); /* * if that didn't work, look for get("foo") */ if (executor.isAlive() == false) { executor = new GetExecutor(rsvc, data, identifier); } /* * finally, look for boolean isFoo() */ if (executor.isAlive() == false) { executor = new BooleanPropertyExecutor(rsvc, data, identifier); } return(executor); }
/// <summary> /// Property getter /// </summary> public IVelPropertyGet GetPropertyGet(Object obj, String identifier, Info i) { AbstractExecutor executor; Type claz = obj.GetType(); /* * first try for a getFoo() type of property * (also getfoo() ) */ executor = new PropertyExecutor(rlog, introspector, claz, identifier); /* * if that didn't work, look for get("foo") */ if (!executor.IsAlive) { executor = new GetExecutor(rlog, introspector, claz, identifier); } /* * finally, look for boolean isFoo() */ if (!executor.IsAlive) { executor = new BooleanPropertyExecutor(rlog, introspector, claz, identifier); } return new VelGetterImpl(executor); }
/// <summary> introspects the class to find the method name of the node, /// or if that fails, treats the reference object as a map /// and treats the identifier as a key in that map. /// This needs work. /// * /// </summary> /// <param name="data">Class to be introspected /// /// </param> private AbstractExecutor doIntrospection(System.Type data) { AbstractExecutor executor; /* * first try for a getFoo() type of property * (also getfoo() ) */ executor = new PropertyExecutor(rsvc, data, identifier); /* * if that didn't work, look for get("foo") */ if (executor.isAlive() == false) { executor = new GetExecutor(rsvc, data, identifier); } /* * finally, look for boolean isFoo() */ if (executor.isAlive() == false) { executor = new BooleanPropertyExecutor(rsvc, data, identifier); } return executor; }
/// <summary> /// Property getter. /// </summary> public IVelPropertyGet GetPropertyGet(Object obj, String identifier, Info i) { AbstractExecutor executor; Type type = obj.GetType(); // First try for a getFoo() type of property (also getfoo()) executor = new PropertyExecutor(runtimeLogger, introspector, type, identifier); // If that didn't work, look for get("foo") if (!executor.IsAlive) { executor = new GetExecutor(runtimeLogger, introspector, type, identifier); } // If that didn't work, look for boolean isFoo() if (!executor.IsAlive) { executor = new BooleanPropertyExecutor(runtimeLogger, introspector, type, identifier); } // If that didn't work, look for an enumeration if (!executor.IsAlive && (obj is Type) && (obj as Type).IsEnum) { executor = new EnumValueExecutor(runtimeLogger, introspector, obj as Type, identifier); } return new VelGetterImpl(executor); }