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

static boolean net::wuffies::japi::Japize::isEntirelyVisible ( CallWrapper  call  )  [inline, static, package]

Determine whether a method or constructor is entirely visible. If it's not then it should be skipped. A call is entirely visible if its declaring class is entirely visible, its return type is entirely visible, all of its parameter types are entirely visible, all of its thrown exception types are entirely visible, and all the bounds of its type parameters are entirely visible.

Definition at line 1175 of file Japize.java.

References isEntirelyVisible(), and paramsEntirelyVisible().

                                                     {
    if (!Modifier.isPublic(call.getModifiers()) && !Modifier.isProtected(call.getModifiers())) {
      return false;
    }
    if (!isEntirelyVisible(call.getDeclaringClass()) || !paramsEntirelyVisible(call)) return false;

    boolean result = true;
    if (!isEntirelyVisible(call.getReturnType())) {
      result = false;
      lintPrint("method " + call.getDeclaringClass().getName() + "." + call.getName() +
                "() has non-public return type " + call.getReturnType().getTypeSig(call.getDeclaringClass()));
    }
    for (int i = 0; i < call.getParameterTypes().length; i++) {
      if (!isEntirelyVisible(call.getParameterTypes()[i])) {
        result = false;
        lintPrint("method " + call.getDeclaringClass().getName() + "." + call.getName() +
                  "() has non-public type " + call.getParameterTypes()[i].getTypeSig(call.getDeclaringClass()) +
                  " among its parameters");
      }
    }
    // For now don't worry about exception types. Later we may handle them a different way
    // (eg by rendering each one as its closest accessible superclass). But we'll still
    // print the error.
    for (int i = 0; i < call.getExceptionTypes().length; i++) {
      if (!isEntirelyVisible(call.getExceptionTypes()[i])) {
        lintPrint("method " + call.getDeclaringClass().getName() + "." + call.getName() +
                  "() throws non-public exception " + call.getExceptionTypes()[i].getTypeSig(call.getDeclaringClass()));
      }
    }
    return result;
  }


Generated by  Doxygen 1.6.0   Back to index