Examples of Hook


Examples of aQute.lib.converter.Converter.Hook

    assertEquals(f.get("1"), (Integer) 1);
    assertEquals(f.get("2"), (Integer) 2);
  }

  public static void hookTest() throws Exception {
    Converter converter = new Converter().hook(File.class, new Hook() {

      public Object convert(Type dest, Object o) {
        if (o instanceof String) {
          return IO.getFile(new File(""), o.toString());
        }
        return null;
      }

    });
    assertEquals(new Integer(6), converter.convert(Integer.class, "6"));
    assertEquals(new File("src").getAbsoluteFile(), converter.convert(File.class, "src"));

    converter.hook(null, new Hook() {

      public Object convert(Type dest, Object o) throws Exception {
        if (dest instanceof Class) {
          if (Number.class.isAssignableFrom((Class< ? >) dest))
            return 1;
View Full Code Here

Examples of com.espertech.esper.client.annotation.Hook

        String hookClass = null;
        for (int i = 0; i < annotations.length; i++) {
            if (!(annotations[i] instanceof Hook)) {
                continue;
            }
            Hook hook = (Hook) annotations[i];
            if (hook.type() != hookType) {
                 continue;
            }
            hookClass = hook.hook();
        }
        if (hookClass == null) {
            return null;
        }
View Full Code Here

Examples of com.espertech.esper.client.annotation.Hook

        String hookClass = null;
        for (int i = 0; i < annotations.length; i++) {
            if (!(annotations[i] instanceof Hook)) {
                continue;
            }
            Hook hook = (Hook) annotations[i];
            if (hook.type() != hookType) {
                 continue;
            }
            hookClass = hook.hook();
        }
        if (hookClass == null) {
            return null;
        }
View Full Code Here

Examples of com.espertech.esper.client.annotation.Hook

        String hookClass = null;
        for (int i = 0; i < annotations.length; i++) {
            if (!(annotations[i] instanceof Hook)) {
                continue;
            }
            Hook hook = (Hook) annotations[i];
            if (hook.type() != hookType) {
                 continue;
            }
            hookClass = hook.hook();
        }
        if (hookClass == null) {
            return null;
        }
View Full Code Here

Examples of com.espertech.esper.client.annotation.Hook

        String hookClass = null;
        for (int i = 0; i < annotations.length; i++) {
            if (!(annotations[i] instanceof Hook)) {
                continue;
            }
            Hook hook = (Hook) annotations[i];
            if (hook.type() != hookType) {
                 continue;
            }
            hookClass = hook.hook();
        }
        if (hookClass == null) {
            return null;
        }
View Full Code Here

Examples of com.espertech.esper.client.annotation.Hook

        String hookClass = null;
        for (int i = 0; i < annotations.length; i++) {
            if (!(annotations[i] instanceof Hook)) {
                continue;
            }
            Hook hook = (Hook) annotations[i];
            if (hook.type() != hookType) {
                 continue;
            }
            hookClass = hook.hook();
        }
        if (hookClass == null) {
            return null;
        }
View Full Code Here

Examples of com.espertech.esper.client.annotation.Hook

        String hookClass = null;
        for (int i = 0; i < annotations.length; i++) {
            if (!(annotations[i] instanceof Hook)) {
                continue;
            }
            Hook hook = (Hook) annotations[i];
            if (hook.type() != hookType) {
                 continue;
            }
            hookClass = hook.hook();
        }
        if (hookClass == null) {
            return null;
        }
View Full Code Here

Examples of com.github.zhongl.housemd.instrument.Hook

        return true;
    }

    @Override
    public Hook hook() {
        return new Hook() {
            private final Set<Object> targets = new HashSet<Object>();
            private final FieldFilter accessor = fieldFilter.apply();

            public void enterWith(Context context) {
            }
View Full Code Here

Examples of com.jcabi.github.Hook

     * @throws Exception if something goes wrong.
     */
    @Test
    public void canDeleteSingleHook() throws Exception {
        final Hooks hooks = MkHooksTest.repo().hooks();
        final Hook hook = hooks.create(
            // @checkstyle MultipleStringLiterals (1 line)
            "geocommit", Collections.<String, String>emptyMap()
        );
        MatcherAssert.assertThat(
            hooks.iterate(),
            Matchers.<Hook>iterableWithSize(1)
        );
        hooks.remove(hook.number());
        MatcherAssert.assertThat(
            hooks.iterate(),
            Matchers.emptyIterable()
        );
    }
View Full Code Here

Examples of com.jcabi.github.Hook

     * @throws Exception if some problem inside
     */
    @Test
    public void canFetchSingleHook() throws Exception {
        final Hooks hooks = MkHooksTest.repo().hooks();
        final Hook hook = hooks.create(
            // @checkstyle MultipleStringLiterals (1 line)
            "geocommit", Collections.<String, String>emptyMap()
        );
        MatcherAssert.assertThat(
            hooks.get(hook.number()),
            Matchers.notNullValue()
        );
    }
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.