Examples of Inject


Examples of org.apache.tapestry.annotations.Inject

    @Test
    public void anonymous_injection()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newMock(Inject.class);
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
        train_getFieldAnnotation(ct, "myfield", Inject.class, annotation);
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    @Test
    public void anonymous_injection_not_provided()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newMock(Inject.class);
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
        train_getFieldAnnotation(ct, "myfield", Inject.class, annotation);
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    @Test
    public void fields_with_annotations()
    {
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        Inject fredAnnotation = mockInject();
        Inject barneyAnnotation = mockInject();
        Id barneyId = newId();

        String barneyFieldName = "_barneyBlock";
        String fredFieldName = "fred";
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    public void transform(ClassTransformation transformation, MutableComponentModel model)
    {
        for (String fieldName : transformation.findFieldsWithAnnotation(Inject.class))
        {
            Inject annotation = transformation.getFieldAnnotation(fieldName, Inject.class);

            String fieldType = transformation.getFieldType(fieldName);

            boolean result = _injectionProvider.provideInjection(
                    fieldName,
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

        String resourcesFieldName = transformation.getResourcesFieldName();

        for (String fieldName : fieldNames)
        {
            Inject injectAnnotation = transformation.getFieldAnnotation(fieldName, Inject.class);

            if (injectAnnotation == null) continue;

            Id annotation = transformation.getFieldAnnotation(fieldName, Id.class);
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    public void transform(ClassTransformation transformation, MutableComponentModel model)
    {
        for (String fieldName : transformation.findFieldsWithAnnotation(Inject.class))
        {
            Inject annotation = transformation.getFieldAnnotation(fieldName, Inject.class);

            inject(fieldName, transformation, model);

            transformation.claimField(fieldName, annotation);
        }
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

        builder.begin();

        for (String name : names)
        {

            Inject annotation = transformation.getFieldAnnotation(name, Inject.class);

            // If the field has no annotation, or no value for its annotation, that's probably
            // a programmer error, but we'll let the later Inject-related workers complain about it.

            if (annotation == null)
                continue;

            String path = annotation.value();

            if (path.equals(""))
                continue;

            // This is tricky because we support sublcasses; if we ask the component at runtime for
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    @Test
    public void asset_field_annotation_has_blank_value()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        Inject annotation = newMock(Inject.class);

        train_findFieldsOfType(ct, InjectAssetWorker.ASSET_TYPE_NAME, "_fred");

        train_getFieldAnnotation(ct, "_fred", Inject.class, annotation);
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    @Test
    public void asset_field_with_full_annotation()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        Inject annotation = newMock(Inject.class);
        AssetSource source = newMock(AssetSource.class);
        Resource r = newResource();

        train_findFieldsOfType(ct, InjectAssetWorker.ASSET_TYPE_NAME, "_fred");
View Full Code Here

Examples of org.apache.tapestry.ioc.annotations.Inject

            String serviceId = is.value();

            return locator.getService(serviceId, parameterType);
        }

        Inject i = findAnnotation(parameterAnnotations, Inject.class);

        if (i != null)
        {
            String reference = i.value();

            return locator.getObject(reference, parameterType);
        }

        // See if we have any "pre-determined" parameter type to object mappings
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.