Package org.apache.tapestry.annotations

Examples of org.apache.tapestry.annotations.Property


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

            String propertyName = InternalUtils.capitalize(InternalUtils.stripMemberPrefix(fieldName));

            String fieldType = transformation.getFieldType(fieldName);

            if (annotation.read())
            {
                TransformMethodSignature getter
                        = new TransformMethodSignature(Modifier.PUBLIC | Modifier.FINAL, fieldType,
                                                       "get" + propertyName,
                                                       null, null);

                transformation.addTransformedMethod(getter, "return " + fieldName + ";");
            }

            if (annotation.write())
            {
                TransformMethodSignature setter
                        = new TransformMethodSignature(Modifier.PUBLIC | Modifier.FINAL, "void", "set" + propertyName,
                                                       new String[] { fieldType }, null);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.annotations.Property

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.