Package org.mokai.type

Examples of org.mokai.type.ActionType


    TypeLoader typeLoader = new PluginTypeLoader(mockPluginMechanism());

    Set<ActionType> actionTypes = typeLoader.loadActionTypes();
    Assert.assertEquals(1,actionTypes.size());

    ActionType actionType = actionTypes.iterator().next();
    Assert.assertNotNull(actionType);
    Assert.assertEquals(actionType.getName(), "");
    Assert.assertEquals(actionType.getDescription(), "");
    Assert.assertEquals(actionType.getActionClass(), MockAction.class);
  }
View Full Code Here


    StandardTypeLoader typeLoader = new StandardTypeLoader();

    Set<ActionType> actionTypes = typeLoader.loadActionTypes();
    Assert.assertTrue(actionTypes.size() > 0);

    ActionType test = new ActionType("", "", MockAction.class);
    Assert.assertTrue(actionTypes.contains(test));
  }
View Full Code Here

  public final Set<ActionType> loadActionTypes() {
    Set<ActionType> actionTypes = new HashSet<ActionType>();

    Set<Class<? extends Action>> actionClasses = pluginMechanism.loadTypes(Action.class);
    for (Class<? extends Action> actionClass : actionClasses) {
      ActionType actionType = TypeBuilder.buildActionType(actionClass);
      actionTypes.add(actionType);
    }

    return actionTypes;
  }
View Full Code Here

    ServiceLoader<Action> serviceLoader = ServiceLoader.load(Action.class);

    for (Action action : serviceLoader) {
      Class<? extends Action> actionClass = action.getClass();
      ActionType actionType = TypeBuilder.buildActionType(actionClass);
      actionTypes.add(actionType);
    }

    return actionTypes;
  }
View Full Code Here

  public static ActionType buildActionType(Class<? extends Action> actionClass) {
    String name = getName(actionClass);
    String description = getDescription(actionClass);

    return new ActionType(name, description, actionClass);
  }
View Full Code Here

TOP

Related Classes of org.mokai.type.ActionType

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.