Package org.apache.tapestry5.plastic

Examples of org.apache.tapestry5.plastic.PlasticClassTransformer


        this.environment = environment;
    }

    public <T> T build(final Class<T> serviceType)
    {
        ClassInstantiator<T> instantiator = proxyFactory.createProxy(serviceType, new PlasticClassTransformer()
        {
            public void transform(PlasticClass plasticClass)
            {
                PlasticMethod delegateMethod = plasticClass.introducePrivateMethod(
                        PlasticUtils.toTypeName(serviceType), "delegate", null, null);
View Full Code Here


        return build(registry);
    }

    private <S> S createProxy(final Class<S> interfaceType, final StrategyRegistry<S> registry)
    {
        ClassInstantiator instantiator = proxyFactory.createProxy(interfaceType, new PlasticClassTransformer()
        {
            public void transform(PlasticClass plasticClass)
            {
                final PlasticField registryField = plasticClass.introduceField(StrategyRegistry.class, "registry")
                        .inject(registry);
View Full Code Here

    /**
     * Creates a class and an instance of that class. Updates the cache and returns the instance.
     */
    private <S> S createInstance(final Class<S> serviceInterface)
    {
        ClassInstantiator instantiator = proxyFactory.createProxy(serviceInterface, new PlasticClassTransformer()
        {
            public void transform(PlasticClass plasticClass)
            {
                plasticClass.addToString(String.format("<NoOp %s>", serviceInterface.getName()));
            }
View Full Code Here

        Object[] array = (Object[]) Array.newInstance(commandInterface, commands.size());

        final Object[] commandsArray = commands.toArray(array);

        ClassInstantiator<T> instantiator = proxyFactory.createProxy(commandInterface, new PlasticClassTransformer()
        {
            public void transform(PlasticClass plasticClass)
            {
                PlasticField commandsField = plasticClass.introduceField(commandsArray.getClass(), "commands").inject(
                        commandsArray);
View Full Code Here

        return result;
    }

    private <T> ClassInstantiator<T> createInstantiator(final Class<T> interfaceType)
    {
        return proxyFactory.createProxy(interfaceType, new PlasticClassTransformer()
        {
            @Override
            public void transform(PlasticClass plasticClass)
            {
                final PlasticField objectCreatorField = plasticClass.introduceField(ObjectCreator.class, "creator")
View Full Code Here

        return build(registry);
    }

    private <S> S createProxy(final Class<S> interfaceType, final StrategyRegistry<S> registry)
    {
        ClassInstantiator instantiator = proxyFactory.createProxy(interfaceType, new PlasticClassTransformer()
        {
            @Override
            public void transform(PlasticClass plasticClass)
            {
                final PlasticField registryField = plasticClass.introduceField(StrategyRegistry.class, "registry")
View Full Code Here

    /**
     * Creates a class and an instance of that class. Updates the cache and returns the instance.
     */
    private <S> S createInstance(final Class<S> serviceInterface)
    {
        ClassInstantiator instantiator = proxyFactory.createProxy(serviceInterface, new PlasticClassTransformer()
        {
            @Override
            public void transform(PlasticClass plasticClass)
            {
                plasticClass.addToString(String.format("<NoOp %s>", serviceInterface.getName()));
View Full Code Here

        Object[] array = (Object[]) Array.newInstance(commandInterface, commands.size());

        final Object[] commandsArray = commands.toArray(array);

        ClassInstantiator<T> instantiator = proxyFactory.createProxy(commandInterface, new PlasticClassTransformer()
        {
            @Override
            public void transform(PlasticClass plasticClass)
            {
                PlasticField commandsField = plasticClass.introduceField(commandsArray.getClass(), "commands").inject(
View Full Code Here

    }

    private Object createProxyInstance(final ObjectCreator creator, final ServiceProxyToken token,
            final Class serviceInterface, final Class serviceImplementation, final String description)
    {
        ClassInstantiator instantiator = proxyFactory.createProxy(serviceInterface, new PlasticClassTransformer()
        {
            public void transform(final PlasticClass plasticClass)
            {
                plasticClass.introduceInterface(Serializable.class);
View Full Code Here

    public <T> T createProxy(final Class<T> interfaceType, final ObjectCreator<T> creator, final String description)
    {
        assert creator != null;
        assert InternalUtils.isNonBlank(description);

        ClassInstantiator<T> instantiator = createProxy(interfaceType, new PlasticClassTransformer()
        {
            public void transform(PlasticClass plasticClass)
            {
                final PlasticField objectCreatorField = plasticClass.introduceField(ObjectCreator.class, "creator")
                        .inject(creator);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.plastic.PlasticClassTransformer

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.