Examples of MethodFilter


Examples of javassist.util.proxy.MethodFilter

      types = new Class[] { Configuration.class, TaskAttemptID.class, RecordWriter.class, OutputCommitter.class,
          StatusReporter.class };
      args = new Object[] { conf, new TaskAttemptID(), null, null, null };
      factory.setSuperclass(superType);
    }
    factory.setFilter(new MethodFilter() {
      @Override
      public boolean isHandled(Method m) {
        String name = m.getName();
        return "getConfiguration".equals(name) || "getCounter".equals(name) || "progress".equals(name);
      }
View Full Code Here

Examples of javassist.util.proxy.MethodFilter

  @SuppressWarnings("unchecked")
  private <T> Class<T> createTheProxy(Class<?> mainClass) {
    ProxyFactory f = new ProxyFactory();
    f.setSuperclass(mainClass);
    f.setInterfaces(new Class[] {NoSqlProxy.class});
    f.setFilter(new MethodFilter() {
      public boolean isHandled(Method m) {
        // ignore finalize()
        if(m.getName().equals("finalize"))
          return false;
        else if(m.getName().equals("equals"))
View Full Code Here

Examples of org.apache.commons.proxy.interceptor.MethodFilter

*/
public class TestPatternFilter extends TestCase
{
    public void testAccepts() throws Exception
    {
        final MethodFilter filter = PatternFilter.getterSetterFilter();
        assertTrue( filter.accepts( Date.class.getMethod( "getSeconds", new Class[] {} ) ) );
        assertTrue( filter.accepts( Date.class.getMethod( "getMinutes"new Class[] {} ) ) );
        assertTrue( filter.accepts( Date.class.getMethod( "setSeconds"new Class[] { Integer.TYPE } ) ) );
        assertTrue( filter.accepts( Date.class.getMethod( "setMinutes"new Class[] { Integer.TYPE } ) ) );
        assertFalse( filter.accepts( Date.class.getMethod( "toString"new Class[] {} ) ) );
        assertFalse( filter.accepts( Date.class.getMethod( "hashCode"new Class[] {} ) ) );
    }
View Full Code Here

Examples of org.apache.tapestry.services.MethodFilter

        final ClassTransformation ct = createClassTransformation(AnnotatedPage.class, log);

        // Duplicates, somewhat less efficiently, the logic in find_methods_with_annotation().

        MethodFilter filter = new MethodFilter()
        {
            public boolean accept(MethodSignature signature)
            {
                return ct.getMethodAnnotation(signature, SetupRender.class) != null;
            }
View Full Code Here

Examples of org.apache.tapestry.services.MethodFilter

        final ClassTransformation ct = createClassTransformation(AnnotatedPage.class, logger);

        // Duplicates, somewhat less efficiently, the logic in find_methods_with_annotation().

        MethodFilter filter = new MethodFilter()
        {
            public boolean accept(TransformMethodSignature signature)
            {
                return ct.getMethodAnnotation(signature, SetupRender.class) != null;
            }
View Full Code Here

Examples of org.apache.tapestry.services.MethodFilter

            {
                // Can't think of a way to do this without duplicating some code out of
                // InternalClassTransformationImpl

                List<MethodSignature> result = newList();
                MethodFilter filter = (MethodFilter) EasyMock.getCurrentArguments()[0];

                for (MethodSignature sig : signatures)
                {
                    if (filter.accept(sig)) result.add(sig);
                }

                // We don't have to sort them for testing purposes. Usually there's just going to be
                // one in there.
View Full Code Here

Examples of org.apache.tapestry.services.MethodFilter

    private final static int ANY_NUMBER_OF_PARAMETERS = -1;

    public void transform(final ClassTransformation transformation, MutableComponentModel model)
    {
        MethodFilter filter = new MethodFilter()
        {
            public boolean accept(MethodSignature signature)
            {
                return signature.getMethodName().startsWith("on")
                        || transformation.getMethodAnnotation(signature, OnEvent.class) != null;
View Full Code Here

Examples of org.apache.tapestry.services.MethodFilter

        final ClassTransformation ct = createClassTransformation(AnnotatedPage.class, logger);

        // Duplicates, somewhat less efficiently, the logic in find_methods_with_annotation().

        MethodFilter filter = new MethodFilter()
        {
            public boolean accept(TransformMethodSignature signature)
            {
                return ct.getMethodAnnotation(signature, SetupRender.class) != null;
            }
View Full Code Here

Examples of org.apache.tapestry.services.MethodFilter

        final ClassTransformation ct = createClassTransformation(AnnotatedPage.class, log);

        // Duplicates, somewhat less efficiently, the logic in find_methods_with_annotation().

        MethodFilter filter = new MethodFilter()
        {
            public boolean accept(MethodSignature signature)
            {
                return ct.getMethodAnnotation(signature, SetupRender.class) != null;
            }
View Full Code Here

Examples of org.apache.tapestry.services.MethodFilter

            {
                // Can't think of a way to do this without duplicating some code out of
                // InternalClassTransformationImpl

                List<MethodSignature> result = newList();
                MethodFilter filter = (MethodFilter) EasyMock.getCurrentArguments()[0];

                for (MethodSignature sig : signatures)
                {
                    if (filter.accept(sig))
                        result.add(sig);
                }

                // We don't have to sort them for testing purposes. Usually there's just going to be
                // one in there.
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.