Package org.apache.tapestry5.annotations

Examples of org.apache.tapestry5.annotations.Parameter


    {
        FieldFilter filter = new FieldFilter()
        {
            public boolean accept(String fieldName, String fieldType)
            {
                Parameter annotation = transformation
                        .getFieldAnnotation(fieldName, Parameter.class);

                return annotation != null && annotation.principal();
            }
        };

        List<String> principleFieldNames = transformation.findFields(filter);
View Full Code Here


            convertFieldIntoParameter(name, transformation, model);
    }

    private void convertFieldIntoParameter(String name, ClassTransformation transformation, MutableComponentModel model)
    {
        Parameter annotation = transformation.getFieldAnnotation(name, Parameter.class);

        String parameterName = getParameterName(name, annotation.name());

        model.addParameter(parameterName, annotation.required(), annotation.allowNull(), annotation.defaultPrefix());

        String type = transformation.getFieldType(name);

        boolean cache = annotation.cache();

        String cachedFieldName = transformation.addField(Modifier.PRIVATE, "boolean", name + "_cached");

        String resourcesFieldName = transformation.getResourcesFieldName();

        String invariantFieldName = addParameterSetup(name, annotation.defaultPrefix(), annotation.value(),
                                                      parameterName, cachedFieldName, cache, type, resourcesFieldName,
                                                      transformation);

        addReaderMethod(name, cachedFieldName, invariantFieldName, cache, parameterName, type, resourcesFieldName,
                        transformation);
View Full Code Here

    private void convertFieldIntoParameter(PlasticClass plasticClass, MutableComponentModel model,
                                           PlasticField field)
    {

        Parameter annotation = field.getAnnotation(Parameter.class);

        String fieldType = field.getTypeName();

        String parameterName = getParameterName(field.getName(), annotation.name());

        field.claim(annotation);

        model.addParameter(parameterName, annotation.required(), annotation.allowNull(), annotation.defaultPrefix(),
                annotation.cache());

        MethodHandle defaultMethodHandle = findDefaultMethodHandle(plasticClass, parameterName);

        ComputedValue<FieldConduit<Object>> computedParameterConduit = createComputedParameterConduit(parameterName, fieldType,
                annotation, defaultMethodHandle);
View Full Code Here

            while (i.hasNext())
            {
                String fieldName = i.next();

                Parameter annotation = transformation.getFieldAnnotation(fieldName, Parameter.class);

                // Process the principal annotations on the first pass, handle the others
                // on the second pass.

                boolean process = pass == 0
                                  ? annotation.principal()
                                  : true;

                if (process)
                {
                    convertFieldIntoParameter(fieldName, annotation, transformation, model);
View Full Code Here

    {
        Predicate<TransformField> predicate = new Predicate<TransformField>()
        {
            public boolean accept(TransformField field)
            {
                Parameter annotation = field.getAnnotation(Parameter.class);

                return annotation != null && annotation.principal() == principal;
            }
        };

        return transformation.matchFields(predicate);
    }
View Full Code Here

    }

    private void convertFieldIntoParameter(ClassTransformation transformation, MutableComponentModel model,
            TransformField field)
    {
        Parameter annotation = field.getAnnotation(Parameter.class);

        String fieldType = field.getType();

        String parameterName = getParameterName(field.getName(), annotation.name());

        field.claim(annotation);

        model.addParameter(parameterName, annotation.required(), annotation.allowNull(), annotation.defaultPrefix(),
                annotation.cache());

        ComponentValueProvider<ParameterConduit> provider = createParameterConduitProvider(parameterName, fieldType,
                annotation);

        TransformField conduitField = transformation.addIndirectInjectedField(ParameterConduit.class, parameterName
View Full Code Here

            while (i.hasNext())
            {
                String fieldName = i.next();

                Parameter annotation = transformation.getFieldAnnotation(fieldName, Parameter.class);

                // Process the principal annotations on the first pass, handle the others
                // on the second pass.

                boolean process = pass == 0
                                  ? annotation.principal()
                                  : true;

                if (process)
                {
                    convertFieldIntoParameter(fieldName, annotation, transformation, model);
View Full Code Here

    {
        Predicate<TransformField> predicate = new Predicate<TransformField>()
        {
            public boolean accept(TransformField field)
            {
                Parameter annotation = field.getAnnotation(Parameter.class);

                return annotation != null && annotation.principal() == principal;
            }
        };

        return transformation.matchFields(predicate);
    }
View Full Code Here

    }

    private void convertFieldIntoParameter(ClassTransformation transformation, MutableComponentModel model,
            TransformField field)
    {
        Parameter annotation = field.getAnnotation(Parameter.class);

        String fieldType = field.getType();

        String parameterName = getParameterName(field.getName(), annotation.name());

        field.claim(annotation);

        model.addParameter(parameterName, annotation.required(), annotation.allowNull(), annotation.defaultPrefix(),
                annotation.cache());

        ComponentValueProvider<ParameterConduit> provider = createParameterConduitProvider(parameterName, fieldType,
                annotation);

        TransformField conduitField = transformation.addIndirectInjectedField(ParameterConduit.class, parameterName
View Full Code Here

            while (i.hasNext())
            {
                String fieldName = i.next();

                Parameter annotation = transformation.getFieldAnnotation(fieldName, Parameter.class);

                // Process the principal annotations on the first pass, handle the others
                // on the second pass.

                boolean process = pass == 0
                                  ? annotation.principal()
                                  : true;

                if (process)
                {
                    convertFieldIntoParameter(fieldName, annotation, transformation, model);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.annotations.Parameter

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.