< prev index next >

core/JemmyCore/src/org/jemmy/lookup/PropLookup.java

Print this page




  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package org.jemmy.lookup;
  27 
  28 import org.jemmy.control.Wrap;
  29 import org.jemmy.control.Wrapper;
  30 
  31 /**
  32  *
  33  * @param <CONTROL>
  34  * @author shura
  35  */
  36 public class PropLookup<CONTROL> implements LookupCriteria<CONTROL> {
  37 
  38     String propName;
  39     Wrapper wrapper;
  40     Object value;
  41 
  42     /**
  43      *
  44      * @param propName
  45      * @param value
  46      */
  47     public PropLookup(String propName, Object value) {
  48         this(Wrap.getWrapper(), propName, value);
  49     }
  50     /**
  51      *
  52      * @param wrapper
  53      * @param propName
  54      * @param value
  55      */
  56     public PropLookup(Wrapper wrapper, String propName, Object value) {
  57         this.propName = propName;
  58         this.wrapper = wrapper;
  59         this.value = value;
  60     }
  61 
  62     public boolean check(CONTROL control) {
  63         return wrapper.wrap(Object.class, control).getProperty(propName).equals(value);
  64     }
  65 
  66 }


  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package org.jemmy.lookup;
  27 
  28 import org.jemmy.control.Wrap;
  29 import org.jemmy.control.Wrapper;
  30 
  31 /**


  32  * @author shura
  33  */
  34 public class PropLookup<CONTROL> implements LookupCriteria<CONTROL> {
  35 
  36     String propName;
  37     Wrapper wrapper;
  38     Object value;
  39 





  40     public PropLookup(String propName, Object value) {
  41         this(Wrap.getWrapper(), propName, value);
  42     }
  43 





  44     public PropLookup(Wrapper wrapper, String propName, Object value) {
  45         this.propName = propName;
  46         this.wrapper = wrapper;
  47         this.value = value;
  48     }
  49 
  50     public boolean check(CONTROL control) {
  51         return wrapper.wrap(Object.class, control).getProperty(propName).equals(value);
  52     }
  53 
  54 }
< prev index next >