Examples of Finder


Examples of me.taylorkelly.bigbrother.finder.Finder

        Player player=(Player) send;
        if(BBPermissions.info(player)) {
            if (split.length == 4 && Numbers.isNumber(split[1]) && Numbers.isNumber(split[2]) && Numbers.isNumber(split[3])) {
                World currentWorld = player.getWorld();
                Location loc = new Location(currentWorld, Double.parseDouble(split[1]), Double.parseDouble(split[2]), Double.parseDouble(split[3]));
                Finder finder = new Finder(loc, plugin.getServer().getWorlds(), plugin.worldManager, plugin);
                finder.addReciever(player);
                finder.find();
            } else if (split.length == 5 && Numbers.isNumber(split[1]) && Numbers.isNumber(split[2]) && Numbers.isNumber(split[3]) && Numbers.isNumber(split[4])) {
                World currentWorld = player.getWorld();
                Location loc = new Location(currentWorld, Double.parseDouble(split[1]), Double.parseDouble(split[2]), Double.parseDouble(split[3]));
                Finder finder = new Finder(loc, plugin.getServer().getWorlds(), plugin.worldManager, plugin);
                finder.setRadius(Double.parseDouble(split[4]));
                finder.addReciever(player);
                finder.find();
            } else if (split.length == 5 && Numbers.isNumber(split[1]) && Numbers.isNumber(split[2]) && Numbers.isNumber(split[3])) {
                World currentWorld = player.getWorld();
                Location loc = new Location(currentWorld, Double.parseDouble(split[1]), Double.parseDouble(split[2]), Double.parseDouble(split[3]));
                Finder finder = new Finder(loc, plugin.getServer().getWorlds(), plugin.worldManager, plugin);
                finder.addReciever(player);
                List<Player> targets = plugin.getServer().matchPlayer(split[4]);
                Player findee = null;
                if (targets.size() == 1) {
                    findee = targets.get(0);
                }
                finder.find((findee == null) ? split[4] : findee.getName());
            } else if (split.length == 6 && Numbers.isNumber(split[1]) && Numbers.isNumber(split[2]) && Numbers.isNumber(split[3]) && Numbers.isNumber(split[5])) {
                World currentWorld = player.getWorld();
                Location loc = new Location(currentWorld, Double.parseDouble(split[1]), Double.parseDouble(split[2]), Double.parseDouble(split[3]));
                Finder finder = new Finder(loc, plugin.getServer().getWorlds(), plugin.worldManager, plugin);
                finder.setRadius(Double.parseDouble(split[5]));
                finder.addReciever(player);
                List<Player> targets = plugin.getServer().matchPlayer(split[4]);
                Player findee = null;
                if (targets.size() == 1) {
                    findee = targets.get(0);
                }
                finder.find((findee == null) ? split[4] : findee.getName());
            } else {
                player.sendMessage(BigBrother.premessage + "usage is " + ChatColor.RED + "/bb find <x> <y> <z>");
                player.sendMessage("or " + ChatColor.RED + "/bb find <x> <y> <z> <radius>");
                player.sendMessage("or " + ChatColor.RED + "/bb find <x> <y> <z> <name>");
                player.sendMessage("or " + ChatColor.RED + "/bb find <x> <y> <z> <name> <radius>");
View Full Code Here

Examples of net.sf.autodao.Finder

  private boolean offset;
  private int indexed;

  protected ParametersChecker(@NotNull final Method method,
                              @NotNull final Map<Class<?>, QueryArgumentTransformer<?, ?>> transformers) {
    final Finder f = AnnotationUtils.getAnnotation(method, Finder.class);
    if (f == null)
      throw new SpecificationViolationException("Method is neither a finder method nor is implemented in AutoDAO", method);

    final int sum
        = (hasText(f.query()) ? 1 : 0)
        + (hasText(f.queryName()) ? 1 : 0)
        + (hasText(f.sqlQuery()) ? 1 : 0)
        + (hasText(f.sqlQueryName()) ? 1 : 0);
    if (sum < 1)
      throw new SpecificationViolationException("You need to specify at least one of: query, queryName, sqlQuery, sqlQueryName", method);

    if (sum > 1)
      throw new SpecificationViolationException("You can specify only one of: query, queryName, sqlQuery, sqlQueryName", method);
View Full Code Here

Examples of net.sf.autodao.Finder

   * @return <code>true</code> if method is single-find, <code>false</code> otherwise.
   * @throws SpecificationViolationException
   *
   */
  private static boolean validateReturnType(@NotNull final Method method) {
    final Finder f = AnnotationUtils.findAnnotation(method, Finder.class);
    final boolean singleFind = !Collection.class.isAssignableFrom(method.getReturnType());
    if (!singleFind) {
      final Class<?> returnType = method.getReturnType();
      if (!returnType.isAssignableFrom(f.returnAs())) {
        throw new SpecificationViolationException(
            "@Finder.returnAs value (" + f.returnAs().getName()
                + ") cannot be cast to method return type (" + returnType.getName() + ")", method
        );
      } else if (f.returnAs() != List.class) {
        if (f.returnAs().isInterface()) {
          throw new SpecificationViolationException(
              "@Finder.returnAs value (" + f.returnAs().getName() + ") cannot be an interface", method
          );
        } else {
          try {
            f.returnAs().getConstructor();
          } catch (NoSuchMethodException e) {
            throw new SpecificationViolationException(
                "@Finder.returnAs value (" + f.returnAs().getName() + ") doesn't have no-arg constructor.", method
            );
          }
        }
      }
    }
View Full Code Here

Examples of net.sf.autodao.Finder

  interface ParameterCallback {
    void visit(final int index, @NotNull final Class<?> type, @NotNull final Annotation[] annotations);
  }

  public static <T> T visitQuery(@NotNull final Method method, @NotNull final QueryVisitor<T> visitor) {
    final Finder finder = AnnotationUtils.findAnnotation(method, Finder.class);
    if (StringUtils.hasText(finder.query())) {
      return visitor.visitQuery(finder.query());
    } else if (StringUtils.hasText(finder.sqlQuery())) {
      return visitor.visitSQLQuery(finder.sqlQuery());
    } else if (StringUtils.hasText(finder.sqlQueryName())) {
      return visitor.visitSQLNamedQuery(finder.sqlQueryName());
    } else {
      Assert.hasText(finder.queryName());
      return visitor.visitNamedQuery(finder.queryName());
    }
  }
View Full Code Here

Examples of net.sf.swtbot.finder.Finder

   *
   * @param controlFinder the {@link ControlFinder} used to identify and find controls.
   * @param menuFinder the {@link MenuFinder} used to find menu items.
   */
  public SWTBot(ControlFinder controlFinder, MenuFinder menuFinder) {
    this(new Finder(controlFinder, menuFinder));
  }
View Full Code Here

Examples of org.apache.ws.scout.Finder

        {
            RegistryService rs = connection.getRegistryService();
            blm = rs.getBusinessLifeCycleManager();
            bqm = rs.getBusinessQueryManager();
            Creator creator = new Creator(blm);
            Finder finder = new Finder(bqm, uddiversion);
           
            Collection<Organization> orgs = new ArrayList<Organization>();
            Organization organization = creator.createOrganization(this.getClass().getName());
//          Add a Service
            Service service = creator.createService(this.getClass().getName());
            ServiceBinding serviceBinding = creator.createServiceBinding();
            service.addServiceBinding(serviceBinding);
            organization.addService(service);
            //Add a classification
            ClassificationScheme cs = finder.findClassificationSchemeByName(this.getClass().getName());
            Classification classification = creator.createClassification(cs);
            organization.addClassification(classification);
           
            User user = blm.createUser();
            PersonName personName = blm.createPersonName(PERSON_NAME);
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.finders.Finder

   * @param matcher a matcher.
   * @return a widget within the parent widget that matches the specified matcher.
   * @throws WorkbenchPartNotActiveException if the part is not the active part.
   */
  protected Widget findWidget(Matcher<?> matcher) {
    Finder finder = bot.getFinder();
    Control control = ((WorkbenchPartReference) partReference).getPane().getControl();
    boolean shouldFindInvisibleControls = finder.shouldFindInvisibleControls();
    finder.setShouldFindInvisibleControls(true);
    try {
      return bot.widget(matcher, control);
    } catch (Exception e) {
      throw new WidgetNotFoundException("Could not find any control inside the view " + partReference.getPartName(), e); //$NON-NLS-1$
    } finally {
      finder.setShouldFindInvisibleControls(shouldFindInvisibleControls);
    }
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.finders.Finder

   * @param matcher a matcher.
   * @return a widget within the parent widget that matches the specified matcher.
   * @throws WorkbenchPartNotActiveException if the part is not the active part.
   */
  protected Widget findWidget(Matcher<?> matcher) {
    Finder finder = bot.getFinder();
    Control control = getControl();
    boolean shouldFindInvisibleControls = finder.shouldFindInvisibleControls();
    finder.setShouldFindInvisibleControls(true);
    try {
      return bot.widget(matcher, control);
    } catch (Exception e) {
      throw new WidgetNotFoundException("Could not find any control inside the view " + partReference.getPartName(), e); //$NON-NLS-1$
    } finally {
      finder.setShouldFindInvisibleControls(shouldFindInvisibleControls);
    }
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.finders.Finder

   *
   * @param controlFinder the {@link ControlFinder} used to identify and find controls.
   * @param menuFinder the {@link MenuFinder} used to find menu items.
   */
  public SWTBot(ControlFinder controlFinder, MenuFinder menuFinder) {
    this(new Finder(controlFinder, menuFinder));
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.finders.Finder

   *
   * @param controlFinder the {@link ControlFinder} used to identify and find controls.
   * @param menuFinder the {@link MenuFinder} used to find menu items.
   */
  public SWTBotFactory(ControlFinder controlFinder, MenuFinder menuFinder) {
    this(new Finder(controlFinder, menuFinder));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.