Package com.habitsoft.kiyaa.util

Examples of com.habitsoft.kiyaa.util.Name


  /**
   * Get a parameter name, taking into account the @Name annotation, if present.
   */
  public static String getParameterName(JParameter parameter) {
    Name parameterNameAnnotation = parameter.getAnnotation(Name.class);
    String parameterName = parameterNameAnnotation!=null?parameterNameAnnotation.value():parameter.getName();
    return parameterName;
  }
View Full Code Here


                        boolean elemProcessed = false;
                        ArrayList<JMethod> foundSetters = new ArrayList<JMethod>(methods.length);
                        for (int j = 0; j < methods.length; j++) {
                  JMethod method = methods[j];
                  //System.out.println("Looking for "+setMethod+" or "+addMethod+" for "+elem+" found "+method);
                  Name methodNameAnnotation = method.getAnnotation(Name.class);
                  if(methodNameAnnotation != null) {
                    if(!methodNameAnnotation.value().equalsIgnoreCase(childElem.getLocalName()))
                      continue;
                  } else if(!method.getName().equalsIgnoreCase(setMethodName) &&
                    !method.getName().equalsIgnoreCase(addMethodName)) {
                    continue;
                  }
View Full Code Here

   * Helper method to convert a java.lang.reflect.Method into a GeneratorMethodInfo
   * and add it to the methods map.
   */
  static void addMethod(final Method m, HashMap<String, ArrayList<GeneratorMethodInfo>> map) {
    String name = m.getName();
    Name nameAnnotation = m.getAnnotation(Name.class);
    if(nameAnnotation != null) name = nameAnnotation.value();
    ArrayList<GeneratorMethodInfo> overloads = map.get(name);
    if(overloads == null) map.put(m.getName(), overloads = new ArrayList<GeneratorMethodInfo>());
    GeneratorTypeInfo[] parameterTypes = new GeneratorTypeInfo[m.getParameterTypes().length];
    for(int i=0; i < parameterTypes.length; i++) {
      parameterTypes[i] = wrap(m.getParameterTypes()[i]);
View Full Code Here

   * Helper method to convert a java.lang.reflect.Method into a GeneratorMethodInfo
   * and add it to the methods map.
   */
  static void addMethod(final JMethod m, HashMap<String, ArrayList<GeneratorMethodInfo>> map) {
    String name = m.getName();
    Name nameAnnotation = m.getAnnotation(Name.class);
    if(nameAnnotation != null) name = nameAnnotation.value();
    ArrayList<GeneratorMethodInfo> overloads = map.get(name);
    if(overloads == null) map.put(name, overloads = new ArrayList<GeneratorMethodInfo>());
    GeneratorTypeInfo[] parameterTypes = new GeneratorTypeInfo[m.getParameterTypes().length];
    for(int i=0; i < parameterTypes.length; i++) {
      parameterTypes[i] = wrap(m.getParameterTypes()[i]);
View Full Code Here

TOP

Related Classes of com.habitsoft.kiyaa.util.Name

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.