Logo Search packages:      
Sourcecode: japitools version File versions  Download package

static String net::wuffies::japi::Japize::mkIfaceString ( ClassWrapper  c,
String  s,
ClassType  ctype,
GenericWrapper  wrapper 
) [inline, static]

Construct a String consisting of every super-interface of a class separated by "*".

Parameters:
c The class to process.
s Initially "" should be passed; during recursion the string produced so far is passed. This is used to ensure the same interface does not appear twice in the string.
ctype If non-null, all interfaces will first be bound against this type before being displayed.
wrapper The wrapper to verify type parameters against.
Returns:
The name of every super-interface of c, separated by "*" and with a leading "*".

Definition at line 581 of file Japize.java.

References net::wuffies::japi::ClassType::bind(), net::wuffies::japi::ClassType::getJavaRepr(), net::wuffies::japi::ClassType::getWrapper(), and mkIfaceString().

                                                                                                        {

    // First iterate over the class's direct superinterfaces.
    ClassType[] ifaces = c.getInterfaces();
    for (int i = 0; i < ifaces.length; i++) {

      // Bind the interface against ctype, if supplied.
      ClassType iface = ifaces[i];
      if (ctype != null) iface = (ClassType) iface.bind(ctype);

      // If the string does not already contain the interface, and the
      // interface is public/protected, then add it to the string and
      // also process *its* superinterfaces, recursively.
      String repr = iface.getJavaRepr(wrapper);
      if ((s + "*").indexOf("*" + repr + "*") < 0) {
        int mods = iface.getWrapper().getModifiers();
        if (Modifier.isPublic(mods) || Modifier.isProtected(mods)) {
          s += "*" + repr;
        }
        s = mkIfaceString(iface.getWrapper(), s, iface, wrapper);
      }
    }

    // Finally, recursively process the class's superclass, if it has one.
    ClassType sup = c.getSuperclass();
    if (sup != null) {
      if (ctype != null) sup = (ClassType) sup.bind(ctype);
      s = mkIfaceString(sup.getWrapper(), s, sup, wrapper);
    }
    return s;
  }


Generated by  Doxygen 1.6.0   Back to index