maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/trinidad/util/Util.java [104:200]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      if (i > 0 &&
          Character.isUpperCase(ch) &&
          Character.isLowerCase(propertyName.charAt(i-1)))
      {
        constantName.append('_');
      }
      ch = Character.toUpperCase(ch);
      constantName.append(ch);
    }

    if (constantSuffix != null)
      constantName.append(constantSuffix);

    return constantName.toString();
  }

  static public String getPrefixedPropertyName(
    String prefix,
    String propertyName)
  {
    return prefix + Character.toUpperCase(propertyName.charAt(0)) +
           propertyName.substring(1);
  }

  static public String getPropertyClass(PropertyBean property)
  {
    String propertyFullClass = property.getPropertyClass();
    String propertyClass = Util.getClassFromFullClass(propertyFullClass);
    String[] genericTypes = property.getPropertyClassParameters();
    if(genericTypes != null && genericTypes.length > 0)
    {
      StringBuffer buffer = new StringBuffer(60);
      buffer.append(propertyClass);
      buffer.append('<');
      int max = genericTypes.length - 1;
      for(int i = 0; i <= max; i++)
      {
        _buildPropertyClass(buffer, genericTypes[i]);
        if(i < max)
        {
          buffer.append(", ");
        }
      }
      buffer.append('>');

      propertyClass = buffer.toString();
    }

    return propertyClass;
  }

  static public String getMethodNameFromEvent(
    String methodPrefix,
    String eventName,
    String methodSuffix)
  {
    return methodPrefix +
           Character.toUpperCase(eventName.charAt(0)) +
           eventName.substring(1) +
           methodSuffix;
  }

  static public String getMethodReaderFromProperty(
    String propertyName,
    String propertyClass)
  {
    String methodPrefix = ("boolean".equals(propertyClass) ? "is" : "get");
    return getPrefixedPropertyName(methodPrefix, propertyName);
  }

  static public String getEventNameFromEventType(
    String eventFullClass)
  {
    String eventName = getClassFromFullClass(eventFullClass);
    return Character.toLowerCase(eventName.charAt(0)) +
           eventName.substring(1, eventName.length());
  }

  static public boolean isPrimitiveClass(
    String className)
  {
    return "boolean".equals(className) ||
           "byte".equals(className) ||
           "char".equals(className) ||
           "double".equals(className) ||
           "float".equals(className) ||
           "int".equals(className) ||
           "long".equals(className) ||
           "short".equals(className);
  }

  static public String getAlternatePropertyClass(PropertyBean property)
  {
    StringBuffer buffer = new StringBuffer(60);
    _buildPropertyClass(buffer, property.getAlternateClass());

    return buffer.toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/Util.java [97:193]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      if (i > 0 &&
          Character.isUpperCase(ch) &&
          Character.isLowerCase(propertyName.charAt(i-1)))
      {
        constantName.append('_');
      }
      ch = Character.toUpperCase(ch);
      constantName.append(ch);
    }

    if (constantSuffix != null)
      constantName.append(constantSuffix);

    return constantName.toString();
  }

  static public String getPrefixedPropertyName(
    String prefix,
    String propertyName)
  {
    return prefix + Character.toUpperCase(propertyName.charAt(0)) +
           propertyName.substring(1);
  }
  
  static public String getPropertyClass(PropertyBean property)
  {
    String propertyFullClass = property.getPropertyClass();
    String propertyClass = Util.getClassFromFullClass(propertyFullClass);
    String[] genericTypes = property.getPropertyClassParameters();
    if(genericTypes != null && genericTypes.length > 0)
    {
      StringBuffer buffer = new StringBuffer(60);
      buffer.append(propertyClass);
      buffer.append('<');
      int max = genericTypes.length - 1;
      for(int i = 0; i <= max; i++)
      {
        _buildPropertyClass(buffer, genericTypes[i]);
        if(i < max)
        {
          buffer.append(", ");
        }
      }
      buffer.append('>');
      
      propertyClass = buffer.toString();
    }
    
    return propertyClass;
  }

  static public String getMethodNameFromEvent(
    String methodPrefix,
    String eventName,
    String methodSuffix)
  {
    return methodPrefix +
           Character.toUpperCase(eventName.charAt(0)) +
           eventName.substring(1) +
           methodSuffix;
  }

  static public String getMethodReaderFromProperty(
    String propertyName,
    String propertyClass)
  {
    String methodPrefix = ("boolean".equals(propertyClass) ? "is" : "get");
    return getPrefixedPropertyName(methodPrefix, propertyName);
  }

  static public String getEventNameFromEventType(
    String eventFullClass)
  {
    String eventName = getClassFromFullClass(eventFullClass);
    return Character.toLowerCase(eventName.charAt(0)) +
           eventName.substring(1, eventName.length());
  }

  static public boolean isPrimitiveClass(
    String className)
  {
    return "boolean".equals(className) ||
           "byte".equals(className) ||
           "char".equals(className) ||
           "double".equals(className) ||
           "float".equals(className) ||
           "int".equals(className) ||
           "long".equals(className) ||
           "short".equals(className);
  }
  
  static public String getAlternatePropertyClass(PropertyBean property)
  {
    StringBuffer buffer = new StringBuffer(60);
    _buildPropertyClass(buffer, property.getAlternateClass());
    
    return buffer.toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



