Example usage for java.lang Module Module

List of usage examples for java.lang Module Module

Introduction

In this page you can find the example usage for java.lang Module Module.

Prototype

Module(ClassLoader loader) 

Source Link

Document

Create the unnamed Module for the given ClassLoader.

Usage

From source file:appStructure.MainApp.java

/**
 * //from w w w . j  a  va 2 s . c o  m
 * @param questionnaires
 */
private static void creerQuestionaires(Map<String, Module> questionnaires) {

    File folder = new File("./Ressources");
    File[] listOfFiles = folder.listFiles();
    for (int i = 0; i < listOfFiles.length; i++) {
        if (listOfFiles[i].isFile()) {
            String fileName = listOfFiles[i].getName().substring(0, listOfFiles[i].getName().lastIndexOf("."));

            questionnaires.put(WordUtils.uncapitalize(fileName), new Module(fileName));

        }
    }

}

From source file:com.berniesanders.fieldthebern.screens.AddPersonScreen.java

/**
 *//*  w w  w. j a  v a2  s.co  m*/
@Override
public Object createComponent() {
    return DaggerAddPersonScreen_Component.builder().mainComponent(FTBApplication.getComponent())
            .module(new Module(personToEdit)).build();
}

From source file:org.artifactory.build.DetailedBuildRunImpl.java

@Override
@Nonnull//from w  w  w .j a v a2 s  .c o m
public List<Module> getModules() {
    List<Module> modulesToReturn = Lists.newArrayList();
    List<org.jfrog.build.api.Module> buildModules = build.getModules();
    if (buildModules != null) {
        for (org.jfrog.build.api.Module buildModule : buildModules) {
            modulesToReturn.add(new Module(buildModule));
        }
    }
    return modulesToReturn;
}

From source file:com.berniesanders.fieldthebern.screens.AddAddressScreen.java

@Override
public Object createComponent() {
    return DaggerAddAddressScreen_Component.builder().mainComponent(FTBApplication.getComponent())
            .module(new Module(address)).build();
}

From source file:com.berniesanders.fieldthebern.screens.SignupScreen.java

/**
 *///from   ww  w.  j  a va 2 s.  c  o m
@Override
public Object createComponent() {
    return DaggerSignupScreen_Component.builder().mainComponent(FTBApplication.getComponent())
            .module(new Module(userAttributes)).build();
}

From source file:therian.module.SelfContainedTherianModuleTest.java

@Test
public void testWithoutInterfaces() {
    final TherianContext context = Therian.usingModules(new Module(Interfaces.EXCLUDE)).context();

    assertSame("superclass-defined operator", MetasyntacticVariable.FOO, context.eval(new Foo()));
    assertSame("superclass-defined operator dependency", MetasyntacticVariable.FOO, context.eval(new FooDep()));

    assertFalse("excluded interface-defined operator", context.supports(new Bar()));
    assertFalse("excluded interface-defined operator dependency", context.supports(new BarDep()));

    assertSame("locally defined operator", MetasyntacticVariable.BAZ, context.eval(new Baz()));
    assertSame("locally defined operator dependency", MetasyntacticVariable.BAZ, context.eval(new BazDep()));

    assertFalse("non-instantiable operators", context.supports(new Blah()));

    assertEquals("ELCoercionConverter specified by TherianModule#withOperators()", MetasyntacticVariable.FOO,
            context.eval(Convert.to(MetasyntacticVariable.class, Positions.readOnly("FOO"))));

    assertEquals("NOPConverter specified by TherianModule#withOperators()", MetasyntacticVariable.FOO, context
            .eval(Convert.to(MetasyntacticVariable.class, Positions.readOnly(MetasyntacticVariable.FOO))));
}

From source file:therian.module.SelfContainedTherianModuleTest.java

@Test
public void testWithInterfaces() {
    final TherianContext context = Therian.usingModules(new Module(Interfaces.INCLUDE)).context();

    assertSame("superclass-defined operator", MetasyntacticVariable.FOO, context.eval(new Foo()));
    assertSame("superclass-defined operator dependency", MetasyntacticVariable.FOO, context.eval(new FooDep()));

    assertSame("interface-defined operator", MetasyntacticVariable.BAR, context.eval(new Bar()));
    assertSame("interface-defined operator dependency", MetasyntacticVariable.BAR, context.eval(new BarDep()));

    assertSame("locally defined operator", MetasyntacticVariable.BAZ, context.eval(new Baz()));
    assertSame("locally defined operator dependency", MetasyntacticVariable.BAZ, context.eval(new BazDep()));

    assertFalse("non-instantiable operators", context.supports(new Blah()));

    assertEquals("ELCoercionConverter specified by TherianModule#withOperators()", MetasyntacticVariable.FOO,
            context.eval(Convert.to(MetasyntacticVariable.class, Positions.readOnly("FOO"))));

    assertEquals("NOPConverter specified by TherianModule#withOperators()", MetasyntacticVariable.FOO, context
            .eval(Convert.to(MetasyntacticVariable.class, Positions.readOnly(MetasyntacticVariable.FOO))));
}

From source file:architecture.common.license.License.java

public void setModule(String moduleName) {
    modules.add(new Module(moduleName));
}

From source file:architecture.common.license.License.java

public void setModules(String moduleNames[]) {
    for (String moduleName : moduleNames) {
        modules.add(new Module(moduleName));
    }
}

From source file:org.openmrs.module.ModuleUtilTest.java

/**
 * @see org.openmrs.module.ModuleUtil#getPathForResource(org.openmrs.module.Module,String)
 *//*from w ww.  j av a 2s.  c o m*/
@Test
@Verifies(value = "should handle ui springmvc css ui dot css example", method = "getPathForResource(Module,String)")
public void getPathForResource_shouldHandleUiSpringmvcCssUiDotCssExample() throws Exception {
    Module module = new Module("Unit test");
    module.setModuleId("ui.springmvc");
    String path = "/ui/springmvc/css/ui.css";
    Assert.assertEquals("/css/ui.css", ModuleUtil.getPathForResource(module, path));
}