Examples of ConstantParameter


Examples of org.picocontainer.defaults.ConstantParameter

                    // create constant with xstream
                    parseResult = parseElementChild((Element) child);
                    if (parseResult == null) {
                        throw new NanoContainerMarkupException("could not parse constant parameter");
                    }
                    parameters.add(new ConstantParameter(parseResult));
                } else if (DEPENDENCY.equals(name)) {
                    // either key or class must be present. not both
                    // key has prececence
                    dependencyKey = ((Element) child).getAttribute(KEY);
                    if (dependencyKey == null || "".equals(dependencyKey)) {
View Full Code Here

Examples of org.picocontainer.defaults.ConstantParameter

    }



    private Parameter toParameter(Object obj) {
        return obj instanceof Parameter ? (Parameter) obj : new ConstantParameter(obj);
    }
View Full Code Here

Examples of org.picocontainer.defaults.ConstantParameter

    private ComponentAdapter registerComponentImplementation(String[] parameterTypesAsString, String[] parameterValuesAsString, Object key, Class componentImplementation) throws ClassNotFoundException {
        Parameter[] parameters = new Parameter[parameterTypesAsString.length];
        for (int i = 0; i < parameters.length; i++) {
            Object value = BeanPropertyComponentAdapter.convert(parameterTypesAsString[i], parameterValuesAsString[i], getComponentClassLoader());
            parameters[i] = new ConstantParameter(value);
        }
        return picoContainer.registerComponentImplementation(key, componentImplementation, parameters);
    }
View Full Code Here

Examples of org.picocontainer.defaults.ConstantParameter

 
  private ContainerPopulator createContainerPopulator(Reader reader, MutablePicoContainer parent)
            throws ClassNotFoundException {
        NanoContainer nano = new DefaultNanoContainer(getClassLoader());
        Parameter[] parameters = new Parameter[] {
                new ConstantParameter(reader),
                new ConstantParameter(getClassLoader()) };
        nano.registerComponentImplementation(containerBuilderClassName,
                containerBuilderClassName, parameters);
        ContainerBuilder containerBuilder = (ContainerBuilder) nano
                .getPico().getComponentInstance(containerBuilderClassName);
        ObjectReference parentRef = new SimpleReference();
View Full Code Here

Examples of org.picocontainer.defaults.ConstantParameter

            ScriptedContainerBuilderFactory scriptedContainerBuilderFactory = new ScriptedContainerBuilderFactory(scriptReader, builderClassName, Thread.currentThread().getContextClassLoader());
            picoConfiguration = buildContainer(scriptedContainerBuilderFactory.getContainerBuilder());
        }
        ComponentAdapter componentAdapter = null;
        if ( picoConfiguration != null ){
            Parameter[] parameters = new Parameter[]{ new ConstantParameter(picoConfiguration) };
            componentAdapter = nanoContainer.registerComponentImplementation(containerComposerClassName, containerComposerClassName, parameters);
        } else {
            componentAdapter = nanoContainer.registerComponentImplementation(containerComposerClassName);           
        }
        return (ContainerComposer) componentAdapter.getComponentInstance(nanoContainer.getPico());       
View Full Code Here

Examples of org.picocontainer.defaults.ConstantParameter

     */
    private ContainerPopulator createContainerPopulator(String containerBuilderClassName, Reader reader, ClassLoader classLoader)
            throws ClassNotFoundException {
        NanoContainer nano = new DefaultNanoContainer(classLoader);
        Parameter[] parameters = new Parameter[] {
                new ConstantParameter(reader),
                new ConstantParameter(classLoader) };
        nano.registerComponentImplementation(containerBuilderClassName,
                containerBuilderClassName, parameters);
        ContainerBuilder containerBuilder = (ContainerBuilder) nano.getPico()
                .getComponentInstance(containerBuilderClassName);
        //containerBuilder.buildContainer(new SimpleReference(), null, null,
View Full Code Here

Examples of org.picocontainer.defaults.ConstantParameter

    // Some "shared" GUI components
    container.registerComponentInstance(Display.getDefault());
    container.registerComponentImplementation("mainShell", Shell.class);
    container.registerComponentImplementation("mainMenu", Menu.class, new Parameter[] {
        new ComponentParameter("mainShell"), new ConstantParameter(SWT.BAR) });
    container.registerComponentImplementation("commandsMenu", CommandsMenu.class);

    container.registerComponentImplementation("feederArea", Composite.class, new Parameter[] {
        new ComponentParameter("mainShell"), new ConstantParameter(SWT.NONE) });
    container.registerComponentImplementation("controlsArea", Composite.class, new Parameter[] {
        new ComponentParameter("mainShell"), new ConstantParameter(SWT.NONE) });
    container.registerComponentImplementation("startStopButton", Button.class, new Parameter[] {
        new ComponentParameter("controlsArea"), new ConstantParameter(SWT.NONE) });
    container.registerComponentImplementation("feederSelectionCombo", Combo.class,
        new Parameter[] { new ComponentParameter("controlsArea"), new ConstantParameter(SWT.READ_ONLY) });

    // GUI Feeders
    container.registerComponentImplementation(FeederGUIRegistry.class);
    Parameter[] feederGUIParameters = new Parameter[] { new ComponentParameter("feederArea") };
    container.registerComponentImplementation(RangeFeederGUI.class, RangeFeederGUI.class, feederGUIParameters);
    container.registerComponentImplementation(RandomFeederGUI.class, RandomFeederGUI.class, feederGUIParameters);
    container.registerComponentImplementation(FileFeederGUI.class, FileFeederGUI.class, feederGUIParameters);

    container.registerComponentImplementation(OpenerLauncher.class);
    container.registerComponentImplementation(MainWindow.class, MainWindow.class, new Parameter[] {
        new ComponentParameter("mainShell"), anyComponentParameter, new ComponentParameter("feederArea"),
        new ComponentParameter("controlsArea"), new ComponentParameter("feederSelectionCombo"),
        new ComponentParameter("startStopButton"), anyComponentParameter, anyComponentParameter,
        anyComponentParameter, anyComponentParameter, anyComponentParameter, anyComponentParameter,
        anyComponentParameter, anyComponentParameter });
    container.registerComponentImplementation(ResultTable.class, ResultTable.class, new Parameter[] {
        new ComponentParameter("mainShell"), anyComponentParameter, anyComponentParameter,
        anyComponentParameter, anyComponentParameter, anyComponentParameter, anyComponentParameter });
    container.registerComponentImplementation(StatusBar.class, StatusBar.class, new Parameter[] {
        new ComponentParameter("mainShell"), anyComponentParameter, anyComponentParameter, anyComponentParameter, anyComponentParameter });

    container.registerComponentImplementation(MainMenu.class, MainMenu.class, new Parameter[] {
        new ComponentParameter("mainShell"), new ComponentParameter("mainMenu"),
        new ComponentParameter("commandsMenu"), anyComponentParameter, new ConstantParameter(container) });
    container.registerComponentImplementation(MainMenu.ColumnsMenu.class, MainMenu.ColumnsMenu.class,
        new Parameter[] { new ComponentParameter("mainShell"), anyComponentParameter, anyComponentParameter, anyComponentParameter });
    if (Platform.MAC_OS)
      container.registerComponentImplementation(MacApplicationMenu.class);
View Full Code Here

Examples of org.picocontainer.parameters.ConstantParameter

    //noinspection RedundantArrayCreation
    m_container.addComponent(FileDistributionImplementation.class, FileDistributionImplementation.class,
            new Parameter[] { new ComponentParameter(DistributionControlImplementation.class),
                new ComponentParameter(ProcessControlImplementation.class),
                new ConstantParameter(properties.getDistributionDirectory()),
                new ConstantParameter(properties.getDistributionFileFilterPattern()), });

    m_container.addComponent(DispatchClientCommands.class);
    m_container.addComponent(WireFileDistribution.class);
    m_container.addComponent(WireMessageDispatch.class);
    m_container.addComponent(WireDistributedBarriers.class);
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.