org.apache.tapestry.annotations
Class AnnotationUtils

java.lang.Object
  extended by org.apache.tapestry.annotations.AnnotationUtils

public final class AnnotationUtils
extends Object

Since:
4.0
Author:
Howard M. Lewis Ship

Method Summary
static org.apache.hivemind.Location buildLocationForAnnotation(Method method, java.lang.annotation.Annotation annotation, org.apache.hivemind.Resource classResource)
           
static String convertMethodNameToKeyName(String methodName)
          Converts a method name to a property key.
static void copyBindings(IContainedComponent source, IContainedComponent target)
          Copies all bindings of a component to another one.
static String getPropertyName(Method method)
          Determines the property name for a method, by stripping off the is/get/set prefix and decapitalizing the first name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPropertyName

public static String getPropertyName(Method method)
Determines the property name for a method, by stripping off the is/get/set prefix and decapitalizing the first name.

Parameters:
method - accessor method (get/set/is)
Returns:
the property name for the method
Throws:
org.apache.hivemind.ApplicationRuntimeException - if the method is not an accessor or mutator method

convertMethodNameToKeyName

public static String convertMethodNameToKeyName(String methodName)
Converts a method name to a property key. The steps performed are:

The prefix "get" is stripped off (if present)

The letter following "get" is converted to lower case

Other capitalized letters are converted to lower case and preceded with a dash ("-")

Parameters:
methodName - the method to convert
Returns:
the converted key
Since:
4.1.1

copyBindings

public static void copyBindings(IContainedComponent source,
                                IContainedComponent target)
Copies all bindings of a component to another one.

Parameters:
source -
target -
Since:
4.1.1

buildLocationForAnnotation

public static org.apache.hivemind.Location buildLocationForAnnotation(Method method,
                                                                      java.lang.annotation.Annotation annotation,
                                                                      org.apache.hivemind.Resource classResource)


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.