Package org.mokai.type

Examples of org.mokai.type.AcceptorType


    TypeLoader typeLoader = new PluginTypeLoader(mockPluginMechanism());

    Set<AcceptorType> acceptorTypes =  typeLoader.loadAcceptorTypes();
    Assert.assertEquals(acceptorTypes.size(), 1);

    AcceptorType acceptorType = acceptorTypes.iterator().next();
    Assert.assertNotNull(acceptorType);
    Assert.assertEquals(acceptorType.getName(), "MockAcceptor");
    Assert.assertEquals(acceptorType.getDescription(), "Mock Acceptor Description");
    Assert.assertEquals(acceptorType.getAcceptorClass(), MockAcceptor.class);
  }
View Full Code Here


    StandardTypeLoader typeLoader = new StandardTypeLoader();

    Set<AcceptorType> acceptorTypes = typeLoader.loadAcceptorTypes();
    Assert.assertTrue(acceptorTypes.size() > 0);

    AcceptorType test = new AcceptorType("", "", MockAcceptor.class);
    Assert.assertTrue(acceptorTypes.contains(test));
  }
View Full Code Here

  public final Set<AcceptorType> loadAcceptorTypes() {
    Set<AcceptorType> acceptorTypes = new HashSet<AcceptorType>();

    Set<Class<? extends Acceptor>> acceptorClasses = pluginMechanism.loadTypes(Acceptor.class);
    for (Class<? extends Acceptor> acceptorClass : acceptorClasses) {
      AcceptorType acceptorType = TypeBuilder.buildAcceptorType(acceptorClass);
      acceptorTypes.add(acceptorType);
    }

    return acceptorTypes;
  }
View Full Code Here

    ServiceLoader<Acceptor> serviceLoader = ServiceLoader.load(Acceptor.class, this.getClass().getClassLoader());

    for (Acceptor acceptor : serviceLoader) {
      Class<? extends Acceptor> acceptorClass = acceptor.getClass();
      AcceptorType acceptorType = TypeBuilder.buildAcceptorType(acceptorClass);
      acceptorTypes.add(acceptorType);
    }

    return acceptorTypes;
  }
View Full Code Here

  public static AcceptorType buildAcceptorType(Class<? extends Acceptor> acceptorClass) {
    String name = getName(acceptorClass);
    String description = getDescription(acceptorClass);

    return new AcceptorType(name, description, acceptorClass);
  }
View Full Code Here

TOP

Related Classes of org.mokai.type.AcceptorType

Copyright © 2018 www.massapicom. 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.