maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/trinidad/util/Util.java [350:470]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static private void _buildPropertyClass(StringBuffer buffer, String type)
  {
    Matcher matcher = _GENERIC_TYPE.matcher(type);
    if(matcher.matches())
    {
      // Generic type
      buffer.append(Util.getClassFromFullClass(matcher.group(1)));
      buffer.append('<');
      String[] types = matcher.group(2).split(",");
      int max = types.length - 1;
      for(int i = 0; i <= max; i++)
      {
        _buildPropertyClass(buffer, types[i]);
        if(i < max)
        {
          buffer.append(", ");
        }
      }
      buffer.append('>');
    }
    else
    {
      // Non-generic type
      buffer.append(Util.getClassFromFullClass(type));
    }
  }

  static private Set _createPrimitiveTypesSet()
  {
    Set primitives = new TreeSet();
    for (int i=0; i < _PRIMITIVE_TYPES.length; i++)
    {
      String type = _PRIMITIVE_TYPES[i];
      primitives.add(type);
      primitives.add(type + "[]");
    }
    return Collections.unmodifiableSet(primitives);
  }

  static private Set _createReservedWordsSet()
  {
    Set reserved = new TreeSet();
    for (int i=0; i < _RESERVED_WORDS.length; i++)
    {
      String keyword = _RESERVED_WORDS[i];
      reserved.add(keyword);
    }
    return Collections.unmodifiableSet(reserved);
  }

  static private final String[] _PRIMITIVE_TYPES = new String[]
  {// TODO: Shouldn't java.lang.* be specified in that list as well?
    "boolean",
    "byte",
    "char",
    "float",
    "double",
    "int",
    "short",
    "long",
  };

  static private final String[] _RESERVED_WORDS = new String[]
  {
    "abstract",
    "assert",
    "boolean",
    "break",
    "byte",
    "case",
    "catch",
    "char",
    "class",
    "const",
    "continue",
    "default",
    "do",
    "double",
    "else",
    "extends",
    "final",
    "finally",
    "float",
    "for",
    "goto",
    "if",
    "implements",
    "import",
    "instanceof",
    "int",
    "interface",
    "long",
    "native",
    "new",
    "package",
    "private",
    "protected",
    "public",
    "return",
    "short",
    "static",
    "super",
    "switch",
    "synchronized",
    "this",
    "throw",
    "throws",
    "transient",
    "try",
    "void",
    "volatile",
    "while",
  };

  static public final Set RESERVED_WORDS = _createReservedWordsSet();
  static public final Set PRIMITIVE_TYPES = _createPrimitiveTypesSet();

  static private final Pattern _GENERIC_TYPE = Pattern.compile("([^<]+)<(.+)>");

  // no instances
  private Util()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/Util.java [366:486]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static private void _buildPropertyClass(StringBuffer buffer, String type)
  {
    Matcher matcher = _GENERIC_TYPE.matcher(type);
    if(matcher.matches())
    {
      // Generic type
      buffer.append(Util.getClassFromFullClass(matcher.group(1)));
      buffer.append('<');
      String[] types = matcher.group(2).split(",");
      int max = types.length - 1;
      for(int i = 0; i <= max; i++)
      {
        _buildPropertyClass(buffer, types[i]);
        if(i < max)
        {
          buffer.append(", ");
        }
      }
      buffer.append('>');
    }
    else
    {
      // Non-generic type
      buffer.append(Util.getClassFromFullClass(type));
    }
  }

  static private Set _createPrimitiveTypesSet()
  {
    Set primitives = new TreeSet();
    for (int i=0; i < _PRIMITIVE_TYPES.length; i++)
    {
      String type = _PRIMITIVE_TYPES[i];
      primitives.add(type);
      primitives.add(type + "[]");
    }
    return Collections.unmodifiableSet(primitives);
  }

  static private Set _createReservedWordsSet()
  {
    Set reserved = new TreeSet();
    for (int i=0; i < _RESERVED_WORDS.length; i++)
    {
      String keyword = _RESERVED_WORDS[i];
      reserved.add(keyword);
    }
    return Collections.unmodifiableSet(reserved);
  }

  static private final String[] _PRIMITIVE_TYPES = new String[]
  {// TODO: Shouldn't java.lang.* be specified in that list as well?
    "boolean",
    "byte",
    "char",
    "float",
    "double",
    "int",
    "short",
    "long",
  };

  static private final String[] _RESERVED_WORDS = new String[]
  {
    "abstract",
    "assert",
    "boolean",
    "break",
    "byte",
    "case",
    "catch",
    "char",
    "class",
    "const",
    "continue",
    "default",
    "do",
    "double",
    "else",
    "extends",
    "final",
    "finally",
    "float",
    "for",
    "goto",
    "if",
    "implements",
    "import",
    "instanceof",
    "int",
    "interface",
    "long",
    "native",
    "new",
    "package",
    "private",
    "protected",
    "public",
    "return",
    "short",
    "static",
    "super",
    "switch",
    "synchronized",
    "this",
    "throw",
    "throws",
    "transient",
    "try",
    "void",
    "volatile",
    "while",
  };

  static public final Set RESERVED_WORDS = _createReservedWordsSet();
  static public final Set PRIMITIVE_TYPES = _createPrimitiveTypesSet();

  static private final Pattern _GENERIC_TYPE = Pattern.compile("([^<]+)<(.+)>");

  // no instances
  private Util()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



